Identify All Cells Not Capital Macro

XLML

Active Member
Joined
Aug 15, 2003
Messages
407
Hi,

I am looking for a macro that will check all cells in any column I choose (Column C for instance).

During the check, it should identify all cells in which alpha characters are not capital. (perhaps by changing the background color of the cell to red)

The only issue I see is that a cell might contain both alpha and numberic characters.

For instance, "998Test" should be flagged b/c the "e", "s" and "t" in the cell are lowercase.

Thanks in advance,
XLML
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
This should do it:

Sub macro()
Dim cell As Range
ActiveCell.EntireColumn.Select 'You may want to limit your selection
For Each cell In Selection
If cell.Text <> UCase(cell.Text) Then cell.Interior.Color = vbred
Next cell
End Sub
 
Upvote 0
You could also use an InputBox() so that the user can define their own range. Example from VBA Help file:
Code:
Set myRange = Application.InputBox(prompt := "Sample", type := 8)
Hope that helps!
 
Upvote 0
This is a modification of tactps sol'n. In this solution you just highligt the rows or columns you want to verify. The difference in this sol'n is that only cells with values in them are looked at .... therefore greatly speeding the process up.

Sub Lcase()
For Each cell In Selection.SpecialCells(xlCellTypeConstants, 3)
If cell.Text <> UCase(cell.Text) Then cell.Interior.Color = vbRed
Next cell
End Sub
 
Upvote 0
Thanks for all the replies. How do I have a message box appear at the end with a count of cells identified?

XLML
 
Upvote 0
Sub Lcase()
C = 0
For Each cell In Selection.SpecialCells(xlCellTypeConstants, 3)
If cell.Text <> UCase(cell.Text) Then cell.Interior.Color = vbRed
C = C + 1
Next cell
pt = MsgBox("Total Found " & C, vbInformation, "Found Cells")
End Sub
 
Upvote 0

Forum statistics

Threads
1,219,006
Messages
6,145,708
Members
450,635
Latest member
Rookie3510

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top