How can i test a cell for bold style in a cell (Excel 2003)?

M

Mike A.

Hi. I want to be able to test a cell to see if the contents are bold. Is
there a way to do this in Excel, or must I write a VB function? Thanks.
 
G

Gary''s Student

The VB part is easy:

Function bold_test(r As Range) As String
If r.Font.FontStyle = "Bold" Then
bold_test = "Bold"
Else
bold_test = "not Bold"
End If
End Function

The hard part is that the function does not automatically update if you
change the target's boldness. If you change the target from bold to not bold
or visa versa, you must touch CNTRL-ALT-F9 to re-calculate the function.
 
Top