I need a line of code that looks at the cell and if it contains a set of words then it does something else:
If Range("A1").Value = "*Tree*" or "*Plant*" or "*Grass*" Then
'does something
else
'does something else
End If
I know this isn’t the right code to achieve what I want but I cannot find the correct way to do this anywhere.
You can use Like
Dim v
v = LCase(Range("A1").Value)
If v Like "*tree*" or v Like "*plant*" or v Like "*grass*" Then
'does something
else
'does something else
End If