Solved

How do I check for any lower case letters in a col in excel ?

Posted on 2013-01-09
3
454 Views
Last Modified: 2013-01-09
I have much data to check

I need to know if  col (A) is in all caps.
I need to know if co (B) is in all lower case.

If I make a mistake my boss says he will apply "capital punishment"

thx


Excel 07
0
Comment
Question by:TIMFOX123
3 Comments
 
LVL 70

Expert Comment

by:KCTS
ID: 38761124
I came across this code on Mr Excel, which would do what you want with any selected range

Public Sub Format_Upcase()
 Application.ScreenUpdating = False 'speed up with large selections
 Application.Calculation = xlManual

 For Each xCell In Selection
 If UCase(xCell.Text) <> xCell.Text Then xCell.Value = UCase(xCell.Text)
 Next

 Application.Calculation = xlAutomatic
 Application.ScreenUpdating = True
 End Sub

 Just highlight the cells that must be in upper case and and run the macro
If you want to put things into lower case then use this macro instead

Public Sub Format_Locase()
 Application.ScreenUpdating = False 'speed up with large selections
 Application.Calculation = xlManual

 For Each xCell In Selection
 If LCase(xCell.Text) <> xCell.Text Then xCell.Value = LCase(xCell.Text)
 Next

 Application.Calculation = xlAutomatic
 Application.ScreenUpdating = True
 End Sub
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 38761142
The following formula returns TRUE if A2 contains all upper case:

=NOT(ISERROR(FIND(UPPER(A2),A2)))

For all lower case:

=NOT(ISERROR(FIND(LOWER(A2),A2)))
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 38761221
Formulawise you could use EXACT function, i.e. UPPER CASE in A2

=EXACT(A2,UPPER(A2))

and for B2 in lower case

=EXACT(B2,LOWER(B2))

regards, barry
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now