Thread: Like Operator
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Like Operator

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