check format

R

Rick Rothstein

Using the Characters.Font property of the cell - something like this
maybe...

Dim Status As String
With Range("A1").Characters.Font
If .Bold Then Status = "Bold, "
If .Italic Then Status = Status & "Italic, "
If .Strikethrough Then Status = Status & "Strikethrough, "
If .Shadow Then Status = Status & "Shadow, "
If .OutlineFont Then Status = Status & "OutlineFont, "
If .Subscript Then Status = Status & "Subscript, "
If .Superscript Then Status = Status & "Superscript, "
If .Underline Then Status = Status & "Underline, "
Status = Status & "Size=" & .Size & ", "
Status = Status & "ColorIndex=" & .ColorIndex
End With
MsgBox Status
 
J

JLGWhiz

This will check the font size and wheter the font is bold in range B2.

Sub chkFont()
s = Range("B2").Font.Size
fs = Range("B2").Font.Bold
MsgBox s & " " & fs
End Sub
 
R

Rick Rothstein

JLGWhiz is correct in using the Font property directly instead of vectoring
through the Characters property. Change the With statement in my posting to
this...

With Range("A1").Font

and use the rest of the code as posted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top