Question about comparing mixed case string values

T

TBA

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

TIA.

-gk-
 
C

Chip Pearson

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
 
O

Otto Moehrbach

What do you mean by "treat" them the same? What do want Excel to do? HTH
Otto
 
B

Bob Phillips

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)
 
T

Tom Ogilvy

As stated,
Option Compare Text

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