title: How to count columns in For Each Next
body: <p>I am using a For Each loop to check every cell in a range for a value.  If the value is present, I need to be able to identify which column the cell is in, and then set a value to a variable based upon that location to identify which product model was received.  </p>
  
  <p>I have attempted to use columns.count, but it seems VBA does not actually view the cell as active in a For Each loop.</p>
  
  <pre><code>For Each ModelCell In Models 'Checks each cell for partial order             
    If ModelCell.Value &gt; "0" Then
      CurrentCount = ModelCell.Value
      TotalReceived = InputBox("How many were received?") 'asks how many were received
      UpdatedCount = CurrentCount - TotalReceived
      If UpdatedCount &gt; "0" Then
        PartialOrder = True
        ModelCell.Value = UpdatedCount
        Range(Cells(RowNumber, 1), Cells(RowNumber, 22)).Interior.Color = rgbAquamarine 
        'Checks all cells and turns green
      End If                                               
    End If
  </code></pre>