ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Question about comparing mixed case string values (https://www.excelbanter.com/excel-programming/288281-question-about-comparing-mixed-case-string-values.html)

TBA[_2_]

Question about comparing mixed case string values
 
What is the command that tells VBA to treat uppercase and lowercase
characters as the same?

TIA.

-gk-



Chip Pearson

Question about comparing mixed case string values
 
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


"TBA" wrote in message
...
What is the command that tells VBA to treat uppercase and

lowercase
characters as the same?

TIA.

-gk-





Otto Moehrbach[_6_]

Question about comparing mixed case string values
 
What do you mean by "treat" them the same? What do want Excel to do? HTH
Otto
"TBA" wrote in message
...
What is the command that tells VBA to treat uppercase and lowercase
characters as the same?

TIA.

-gk-





Bob Phillips[_6_]

Question about comparing mixed case string values
 
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)

"TBA" wrote in message
...
What is the command that tells VBA to treat uppercase and lowercase
characters as the same?

TIA.

-gk-





Tom Ogilvy

Question about comparing mixed case string values
 
As stated,
Option Compare Text

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

--
Regards,
Tom Ogilvy


TBA wrote in message
...
What is the command that tells VBA to treat uppercase and lowercase
characters as the same?

TIA.

-gk-






All times are GMT +1. The time now is 03:07 AM.

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