Captain Smith
Active Member
- Joined
- Feb 28, 2003
- Messages
- 324
I have searched this board and I know somewhere there must be a post like this already, but I cannot find it.
I just want to write a simple VBA statement to identify if a cell contains a certain string, rather than the entire string being equal or not equal to a value.
Something like:
sub hello()
dim cell as range
For Each cell In Selection
if cell.contains (*pickle*) then msgbox ("I like pickles")
Next
End Sub
I know this is the wrong syntax but what is the right syntax?
Thanks!
I just want to write a simple VBA statement to identify if a cell contains a certain string, rather than the entire string being equal or not equal to a value.
Something like:
sub hello()
dim cell as range
For Each cell In Selection
if cell.contains (*pickle*) then msgbox ("I like pickles")
Next
End Sub
I know this is the wrong syntax but what is the right syntax?
Thanks!