Excel VBA: Selection object stuck in first iteration of for each loop, doesn't update?
The first line of the IF statement appears to be caught in the first iteration of the loop. The selection object doesn't seem to update with each iteration. The other lines do appear to update.
Is there a problem using the FIND method inside of a FOR EACH loop? I am thinking that the selection object needs to be deactivated somehow before the end of each iteration.
Any thoughts?
Sub findTotalCosts()
Dim c As Range
For Each c In Range("G:G")
If c.Value Like "TASK*" Then
Columns(2).Find(what:="TOTAL COSTS").Select
'Selection.Offset(0, 7).Select
Cells(c.Row - 2, 11).Value = Selection.Offset(0, 7).Value
Cells(c.Row - 2, 12).Value = c.Offset(-2, -3).Value
End If
Next c
End Sub
