Thread: Like Operator
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Donald[_3_] Donald[_3_] is offline
external usenet poster
 
Posts: 3
Default Like Operator

I'm trying to stop a procedure if an excel cell contains a space.
Example; cell contains <M T91490

I've tried an if statement, but it's not returning the result I'm looking
for.

If activecell.value like " " then
msgbox "Check cell contents"
exit sub
end if

I've also tried this;

If activecell.text like " " then
msgbox "Check cell contents"
exit sub
end if