Solved by GSerg over at Stack overflow:
"
]Dim c As Range
For Each c In Range("S:S").Cells
If instr(c.Value, "USAA") > 0 Or instr(c.Value, "U.S.A.A") > 0 Then
With c.Offset(0, 2)
If .Value = "AM" then .Value = .Value & "8-10"
End With
End If
Next c
InStr finds first instance of a string inside another string.
ActiveCell is the currently selected cell in the active window, not the loop counter. It is advisable to avoid using ActiveCell (and .Select) in code, unless you actually want the user to select a cell and then act upon it.
With...End With is just a handy way to temporarily capture a reference to c.Offset(0, 2), to avoid explicit variable for it or calling it three times in a row. Without this block, it would be
If c.Offset(0, 2).Value = "AM" Then
c.Offset(0, 2).Value = c.Offset(0, 2).Value & "8-10"
End If
"
Bookmarks