Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Spreadsheets (https://www.askmehelpdesk.com/forumdisplay.php?f=395)
-   -   Highlight Uppercase in Excel (https://www.askmehelpdesk.com/showthread.php?t=749168)

  • May 16, 2013, 02:01 AM
    navraj1987
    Highlight Uppercase in Excel
    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
  • May 21, 2013, 07:16 AM
    JBeaucaire
    So your macro above is working, you just don't like having to select cells first?

    How about this then:

    Code:

    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


  • All times are GMT -7. The time now is 07:57 AM.