Log in

View Full Version : Highlight Uppercase in Excel


navraj1987
May 16, 2013, 02:01 AM
Hi All,

I need to highlight the cells where ever the cell contains uppercase case letters.

Ex. Cell A1 as AAA
Cell A2 as bbb

Here the result should be highlighted in AAA and bbb remains the same.

I have macro for this and given that below with this message. However, I need to select a range for this.

Sub OnlyUpper()
Dim cell As Range
For Each cell In Selection
If cell.Value = UCase(cell.Value) Then
If cell.Value <> "" Then
cell.Font.ColorIndex = 3 'make font color = red
End If
End If
Next
End Sub

Thanks in advance for you help.

Regards,
Navraj Dilly Batcha

JBeaucaire
May 21, 2013, 07:16 AM
So your macro above is working, you just don't like having to select cells first?

How about this then:



Sub OnlyUpper()
Dim cell As Range

For Each cell In ActiveSheet.UsedRange
If Len(cell.Value) > 0 Then
If cell.Value = UCase(cell.Value) Then cell.Font.ColorIndex = 3 'make font color = red
End If
Next cell

End Sub