PDA

View Full Version : Sleeper: Like Function



Dreamer
08-28-2005, 07:26 PM
HI all,

I know that if I want to search for a string which contains a word e.g car,
then I can use like function.. if xTemp.value like "*car*" then......
however, I want to search for any row which contains exactly the symbol "*",
how should I write? " if xTemp.value like "*" then...." is not working...

Thanks a lot!

MWE
08-28-2005, 07:40 PM
HI all,

I know that if I want to search for a string which contains a word e.g car,
then I can use like function.. if xTemp.value like "*car*" then......
however, I want to search for any row which contains exactly the symbol "*",
how should I write? " if xTemp.value like "*" then...." is not working...

Thanks a lot!
Since you are searching for "text", it might make more sense to use xTemp.Text instead of xTemp.Value

Something like


If xTemp.Text = "*" then

should work

I am assuming that you have declared xTemp as a Range and set xTemp = to the target cell or something similar

Bob Phillips
08-29-2005, 05:11 AM
HI all,

I know that if I want to search for a string which contains a word e.g car,
then I can use like function.. if xTemp.value like "*car*" then......
however, I want to search for any row which contains exactly the symbol "*",
how should I write? " if xTemp.value like "*" then...." is not working...

Thanks a lot!

Like "*
*"

.