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

I haven't done any timing tests to see if one is faster than the other, but
I don't think either would have an observable difference.

--
Regards,
Tom Ogilvy

"Donald" wrote in message
news:E0JDc.22030$Lh.2080@okepread01...
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