ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find Left$ (https://www.excelbanter.com/excel-programming/430003-find-left%24.html)

kirkm[_8_]

Find Left$
 
Hi,

I'm changing some existing code which reads

Set rngFound = .Find(What:=theString, after:=.Range("A1"),
LookIn:=xlValues, LookAt:=xlPart, searchorder:=xlByColumns,
searchdirection:=xlNext, MatchCase:=False, matchbyte:=False)

This finds *theString* but what I want it to look at are the
first 2 characters only e.g. "40*" and select only those. ( The
asterisk doesn't work as in an Access query, either)

Is this possible, or is a completely different method needed?
Thanks - Kirk


Patrick Molloy

Find Left$
 
did yiu try

... .Find(What:= LEFT$( theString ,2) , after:=. ....

"kirkm" wrote in message ...
Hi,

I'm changing some existing code which reads

Set rngFound = .Find(What:=theString, after:=.Range("A1"),
LookIn:=xlValues, LookAt:=xlPart, searchorder:=xlByColumns,
searchdirection:=xlNext, MatchCase:=False, matchbyte:=False)

This finds *theString* but what I want it to look at are the
first 2 characters only e.g. "40*" and select only those. ( The
asterisk doesn't work as in an Access query, either)

Is this possible, or is a completely different method needed?
Thanks - Kirk


kirkm[_8_]

Find Left$
 
On Thu, 18 Jun 2009 12:52:07 +0100, "Patrick Molloy"
wrote:

.Find(What:= LEFT$( theString ,2)


Yes, although that finds every instance of the two characters, not
just cells that start with them. I could filter and fix the result
somehow but maybe there is another way?

Thanks - Kirk


All times are GMT +1. The time now is 10:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com