How to determine BOLD cell format.,...

  • Thread starter Thread starter Rick Norris
  • Start date Start date
R

Rick Norris

I desperately need to be able to test for the existence
of bold formatting of a cell...

Need to do this with an IF statement:

=if( CELL_IS_BOLD, true, false)

If anyone can give some help here it would be greatly
appreciated.

Thanks in advance.

Rick Norris, CPA
Financial Analyst
NorthStar Communications Group
 
one way:

Use this UDF:

Public Function IsBold(rng As Range) As Boolean
Application.Volatile
IsBold = rng.Font.Bold
End Function

Call as

=IsBold(A1)

Note, however, that changing format (i.e., turning a cell bold) will
not cause the worksheet to recalculate, so you'll need to manually
force recalculation with F9 to ensure that the returned value is
correct.
 
Rick,

This should get you started

Sub checkFont()
'add code to loop through the appropreate cells
If ActiveCell.Font.Bold = True Then
MsgBox "It is bold" 'replace with your desired action
Else: MsgBox "It is not Bold" 'replace with your desired
action
End If

End Sub
 
Back
Top