So I wrote a For Loop code that tries to search through a particular column (Column M) of data for cells containing a description starting with "GE90" and replaces an adjecent offset cell (Column C) with "GE90 Hold".
I thought I was using the code correctly but for some reason it does not seem to work.
Dim Cell
For Each Cell In Range("M2:M" & LastRow)
If Cell.Value = "GE90*" Then
Cell.Offset(, -10).Value = "GE90 Hold"
End If
Next Cell
Your issue is actually that you assume the asterisk in "GE90*" is a wildcard, but actually, your code is looking for the literal value "GE90*". Change your code as follows:
Dim Cell
For Each Cell In Range("M2:M" & lastrow)
If Left(Cell.Value, 4) = "GE90" Then
Cell.Offset(, -10).Value = "GE90 Hold"
End If
Next Cell
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With