How to determine BOLD cell format.,...

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
 
J

J.E. McGimpsey

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.
 
J

Jill

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
 

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