Using "Like" to match strings
To make the default for string comparisons case insensitive, put this
statement at the top of the module:
Option Compare Text
Also look at Help for the StrComp function and the arguments for the Instr
function. They allow you to specify the case sensitivity for that particular
comparison statement-by-statement.
On Fri, 2 Nov 2007 09:31:02 -0700, Steve
wrote:
Sorry Arn
I have the 3 letetrs that I am matching. The problem seems to be matching it.
I have since found out that it is case sensitive. How can I get around this?
This is part of the code I am using to test the match:
If sExportCompName Like sTestText = True Then
MsgBox "Match"
GoTo Finish
End If
Thanks
Steve
"Aran Black" wrote:
Hi Steve,
you could try this:
=left(yourcell,3)
where yourcell is the location of the cell you want to deal with.
Aran
--
It wasnt Jesus it was just a fella!
God Bless America!
"Steve" wrote:
Trying to match the first 3 letters of a string to a company name and
can't
seem to get the syntax correct.
I am using variables to do it which I assume is OK.
The Company name can have spaces in it.
e.g. CAD does not appear in Cadbury.
Is is case sensitive?
Any help or a point in the right direction would be appreciated.
Best Regards
Steve
|