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

Thanks to both, appears as though both methods work. Would one method have
any advantage over the other?

--
Donald
"Tom Ogilvy" wrote in message
...
If instr(activecell.text," ") then
msgbox "Check cell contents"
exit sub
end if


--
Regards,
Tom Ogilvy

"Donald" wrote in message
news:wQGDc.22019$Lh.4105@okepread01...
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