Question about comparing mixed case string values

  • Thread starter Thread starter TBA
  • Start date Start date
T

TBA

What is the command that tells VBA to treat uppercase and lowercase
characters as the same?

TIA.

-gk-
 
At the top of the module, use

Option Compare Text

This will cause all text comparisons to be case insensitive.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
What do you mean by "treat" them the same? What do want Excel to do? HTH
Otto
 
Either upshift them

UpCase(Range("A1").Value)

or downshift them

LCase(Range("A1").Value)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
As stated,
Option Compare Text

answers the question asked, but you might not need it.
Also look in VBA help at the strcomp function.
 

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

Similar Threads


Back
Top