ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   UCase? (https://www.excelbanter.com/excel-programming/355797-ucase.html)

vbastarter

UCase?
 
Hi, Its a simple question. I have a large file and i would like to check if
any of the cells are upper case. I thought i could do something simple like
if strtext = ucase(strtext) then....

but then its not able to identify ucase cells that way. Is there any
alternative way to achieve this??? Many THANKS

David McRitchie

UCase?
 
Hi ......,
You could use Conditional Formatting or a Filter to identify the
cells that are uppercase. But is there something that you want
to do with them when you find them.
http://www.mvps.org/dmcritchie/excel/condfmt.htm

Worksheet formulas are normall not case sensitive, but EXACT
requires an EXACT comparison.
=AND(ISTEXT(A1),EXACT(A1,UPPER(A1)))

http://www.mvps.org/dmcritchie/excel/strings.htm

VBA is case sensitive so your formula is correct, probably
in something else you did, numbers will be the same as is
compared to upper case, and I expect you want to try to ignore
such cells at least those that are numeric. Use of SpecialCells.

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"vbastarter" wrote in message ...
Hi, Its a simple question. I have a large file and i would like to check if
any of the cells are upper case. I thought i could do something simple like
if strtext = ucase(strtext) then....

but then its not able to identify ucase cells that way. Is there any
alternative way to achieve this??? Many THANKS




Gary Keramidas

UCase?
 
would something like this work?

If cell.Value "" And cell.Value = UCase(cell.Value) Then

--


Gary


"David McRitchie" wrote in message
...
Hi ......,
You could use Conditional Formatting or a Filter to identify the
cells that are uppercase. But is there something that you want
to do with them when you find them.
http://www.mvps.org/dmcritchie/excel/condfmt.htm

Worksheet formulas are normall not case sensitive, but EXACT
requires an EXACT comparison.
=AND(ISTEXT(A1),EXACT(A1,UPPER(A1)))

http://www.mvps.org/dmcritchie/excel/strings.htm

VBA is case sensitive so your formula is correct, probably
in something else you did, numbers will be the same as is
compared to upper case, and I expect you want to try to ignore
such cells at least those that are numeric. Use of SpecialCells.

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"vbastarter" wrote in message
...
Hi, Its a simple question. I have a large file and i would like to check if
any of the cells are upper case. I thought i could do something simple like
if strtext = ucase(strtext) then....

but then its not able to identify ucase cells that way. Is there any
alternative way to achieve this??? Many THANKS






David McRitchie

UCase?
 
I did forget the reference to another page that might also help,
and includes information on SpecialCells, and macros to
convert to Proper case, Lower case and Upper case.
..
Proper, and other Text changes -- Use of SpecialCells
http://www.mvps.org/dmcritchie/excel/proper.htm



David McRitchie

UCase?
 
Hi Gary,

Yes but you can use SpecialCells to eliminate cells that are not text
as on my proper.htm page.

For Each Cell In Intersect(Rng, Rng.SpecialCells(xlConstants, xlTextValues))
If TRIM(cell.value)< "" And cell.value = LCase(cell.value) Then .
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Gary Keramidas" <GKeramidasATmsn.com wrote in message ...
would something like this work?

If cell.Value "" And cell.Value = UCase(cell.Value) Then

--


Gary


"David McRitchie" wrote in message
...
Hi ......,
You could use Conditional Formatting or a Filter to identify the
cells that are uppercase. But is there something that you want
to do with them when you find them.
http://www.mvps.org/dmcritchie/excel/condfmt.htm

Worksheet formulas are normall not case sensitive, but EXACT
requires an EXACT comparison.
=AND(ISTEXT(A1),EXACT(A1,UPPER(A1)))

http://www.mvps.org/dmcritchie/excel/strings.htm

VBA is case sensitive so your formula is correct, probably
in something else you did, numbers will be the same as is
compared to upper case, and I expect you want to try to ignore
such cells at least those that are numeric. Use of SpecialCells.

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"vbastarter" wrote in message
...
Hi, Its a simple question. I have a large file and i would like to check if
any of the cells are upper case. I thought i could do something simple like
if strtext = ucase(strtext) then....

but then its not able to identify ucase cells that way. Is there any
alternative way to achieve this??? Many THANKS









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

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