How to check for a bold text formating through (in) a formula?

D

Dmitry Kopnichev

Hello experts!
How to check for a bold text formatting through (in) a formula?
 
B

Bob Phillips

A simple UDF will do it

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

and use like

=IF(ISBold(A1),...)

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
D

Dmitry Kopnichev

Thanks Bob.
I opened Visual Basic Editor, clicked menu View, Code, and pasted the
Function IsBold(rng As Range) As Boolean
Application.Volatile
IsBold = rng.Font.Bold
End Function
Then clicked save.
The formula =ISBold(A1) gives #NAME? , where A1 is bold text. What is wrong?
 
D

Dmitry Kopnichev

Thanks. I know now.
Dmitry Kopnichev said:
Thanks Bob.
I opened Visual Basic Editor, clicked menu View, Code, and pasted the
Function IsBold(rng As Range) As Boolean
Application.Volatile
IsBold = rng.Font.Bold
End Function
Then clicked save.
The formula =ISBold(A1) gives #NAME? , where A1 is bold text. What is wrong?
 
J

JMay

Glad you got your answer.
Please Share - what was the problem before
you solved the it?
 
D

Dave Peterson

One typical problem with UDFs is that they weren't placed in a General
module--sometimes, they're placed under a worksheet or under ThisWorkbook and
then the Name error is returned.
 
D

Dmitry Kopnichev

Yes, Dave Peterson is right.
Dave Peterson said:
One typical problem with UDFs is that they weren't placed in a General
module--sometimes, they're placed under a worksheet or under ThisWorkbook and
then the Name error is returned.
 

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