L LuisE Oct 28, 2008 #1 I need a wildcard pattern to find " apt ", the text apt with one space at the begining and one space at the end. Thanks in advance
I need a wildcard pattern to find " apt ", the text apt with one space at the begining and one space at the end. Thanks in advance
L LuisE Oct 28, 2008 #3 Gary, Could you please elaborate? Gary Keramidas said: did you try a "?" ? Click to expand...
D Dave Peterson Oct 28, 2008 #4 Why would you need a wildcard for this? I would think you'd just use that " apt " string??? But if you're using Find, then maybe just looking in xlpart would be sufficient. If you're using like, then maybe: "* apt *" would work
Why would you need a wildcard for this? I would think you'd just use that " apt " string??? But if you're using Find, then maybe just looking in xlpart would be sufficient. If you're using like, then maybe: "* apt *" would work
L LuisE Oct 28, 2008 #5 Thanks for your response Dave, handy as always. I'm using like, i want to find apt as part of and address text. I was using "* apt *" but i realized that it was case sensitive, I had to use Option Compare Text to make it work. Thanks again
Thanks for your response Dave, handy as always. I'm using like, i want to find apt as part of and address text. I was using "* apt *" but i realized that it was case sensitive, I had to use Option Compare Text to make it work. Thanks again
D Dave Peterson Oct 28, 2008 #6 You could have used: if lcase(mystr) like lcase("* apt *") then to make sure you're looking at lower case on either side. There's another function that you may want to keep in mind: InStr It has a parm that you can specify to ignore case. dim AptPos as long aptpos = instr(1,mystr," apt ",vbtextcompare) if aptpos = 0 then 'not there else 'starts at aptpos end if
You could have used: if lcase(mystr) like lcase("* apt *") then to make sure you're looking at lower case on either side. There's another function that you may want to keep in mind: InStr It has a parm that you can specify to ignore case. dim AptPos as long aptpos = instr(1,mystr," apt ",vbtextcompare) if aptpos = 0 then 'not there else 'starts at aptpos end if