Bold format.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way to find through a formula whether the contents in the cell
is fomatted as bold or not?
 
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)
 
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.
 
Back
Top