Colour Uppercase Letters

  • Thread starter Thread starter Paul Black
  • Start date Start date
P

Paul Black

Hi everyone,

I have a list in column B.
There are many titles (Capitalized) followed by descriptions.
For the cells that are completely CAPITALIZED I would like to make the
colour red, the font Tahoma 12, and bold please.

Thanks in advance,
Paul
 
Sub colorCaps()
Dim cell As Range
For Each cell In Selection

If cell.Text = UCase(cell.Text) Then
With cell
.Font.Bold = True
.Font.Color = vbRed
.Font.Name = "Tahoma 12"
End With
End If

Next


End Sub
 
A little more description of your set up would help. Are these titles and
descriptions all in the same cell or is the title in one cell and the
description in the other? If they are all in one cell, then what separates
the title from the description... a line feed, a dash, something else? Also
what cells (rows/columns) are these things in?
 
Sub colorCaps()
    Dim cell As Range
    For Each cell In Selection

        If cell.Text = UCase(cell.Text) Then
            With cell
                .Font.Bold = True
                .Font.Color = vbRed
                .Font.Name = "Tahoma 12"                
            End With
        End If

    Next

End Sub







- Show quoted text -

That's GREAT!, thanks Patrick.
One last thing please, I would also like the cells with a single
capital letter to be blue, 27 and bold.

Thanks in advance,
Paul
 
If cell.Text = UCase(cell.Text) Then
IF LEN(cell.text)=1 then
With cell
.Font.Bold = True
.Font.Color = vbBlue
.Font.Name = "Tahoma 27"
End With

else
With cell
.Font.Bold = True
.Font.Color = vbRed
.Font.Name = "Tahoma 12"
End With
end if
End If
 
         If cell.Text = UCase(cell.Text) Then
IF LEN(cell.text)=1 then
            With cell
                 .Font.Bold = True
                 .Font.Color = vbBlue
                 .Font.Name = "Tahoma 27"               
             End With

else
             With cell
                 .Font.Bold = True
                 .Font.Color = vbRed
                 .Font.Name = "Tahoma 12"               
             End With
end if
         End If







- Show quoted text -

Brilliant Patrick, works a treat, thanks very much.

Kind Regards,
Paul
 
If you don't want to do it with code, you can use Conditional
Formatting. Choose Custom and enter

=EXACT(B1,UPPER(B1))

and set your format.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
Back
Top