Bold format.

G

Guest

Is there any way to find through a formula whether the contents in the cell
is fomatted as bold or not?
 
B

Bob Phillips

with a UDF

Function IsBold(rng As Range) As Boolean
If rng.Cells.Count > 1 Then Exit Function
Application.Volatile
IsBold = rng.Font.Bold
End Function




--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
J

JE McGimpsey

Not via built-in formula.

You could use a UDF like this:

Public Function IsBold(ByRef rng As Excel.Range) As Boolean
Dim rArea As Range
Dim rCell As Range
Dim bResult As Boolean

Application.Volatile
bResult = True
For Each rArea In rng
For Each rCell In rArea
bResult = bResult And rCell.Font.Bold
Next rCell
Next rArea
IsBold = bResult
End Function

Note that changing format doesn't trigger a calculation event, so you'd
need to manually trigger a recalc to make sure that the formula returned
the right value.
 

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