ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Bold format. (https://www.excelbanter.com/excel-discussion-misc-queries/164610-bold-format.html)

Balaji

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

Bob Phillips

Bold format.
 
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)



"Balaji" wrote in message
...
Is there any way to find through a formula whether the contents in the
cell
is fomatted as bold or not?




JE McGimpsey

Bold format.
 
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.

In article ,
Balaji wrote:

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



All times are GMT +1. The time now is 07:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com