Case sensitive data

I

Ian

I am trying to perform a routine based on the value of a
cell. The value is case sensitive and I need it to
distinguish between "GBP" & "GBp" - Can these text strings
be distinguished in VBA?

Rgds
 
C

Chip Pearson

Ian,

Use the StrComp function. This allows you to specify case-insensitive
comparisons.

If StrComp("GBP", "GBp", vbBinaryCompare) = 0 Then
Debug.Print "equal strings"
Else
Debug.Print "not equal strings"
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
C

Chip Pearson

This allows you to specify case-insensitive

Of course, that should be 'case-sensitive'.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
P

pfsardella

See the 'StrComp' function in VBE help. It allows for binary (case
sensitive) and textual comparisons.

HTH
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top