Hi all,
It's been a long time since i used VBA and didn't realize just how much I'd forgotten.
I have a large list of data, and I want to be able to look at the string in Column B and see if it contains any of up to 100 key words (e.g. plc, ltd, limited).
If any of these words are contained, then I would like it to place a Y in Column J, and if not, place a N.
I have so far only entered 3 different strings to search to test the macro, but it is placing a N for all cells in column J when some of them should be a Y.
The code I have so far is:
Sub Test_Macro()
Last = Cells(Rows.Count, "B").End(xlUp).Row
For i = 2 To Last
If (Cells(i, "B").Value) = "*ltd*" Or (Cells(i, "B").Value) = "*limited*" Or (Cells(i, "B").Value) = "*plc*" Then
Cells(i, "J").Value = "Y"
Else: Cells(i, "J").Value = "N"
End If
Next i
End Sub
Any ideas where I going wrong?
Thanks in advance