View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JE McGimpsey
 
Posts: n/a
Default How do I show True as a value in Excel B2 if Cell B1 is bold?

One way:

Put this in a regular code module:

Public Function IsBold(rRng As Range) As Boolean
Dim rCell As Range
Dim bTemp As Boolean
Application.Volatile
If rRng.Count = 1 Then
IsBold = rRng.Font.Bold
Else
bTemp = True
For Each rCell In rRng
bTemp = bTemp And rCell.Font.Bold
If Not bTemp Then Exit For
Next rCell
IsBold = bTemp
End If
End Function


Since changing format doesn't trigger a calculation, this can only be
guaranteed to be accurate after recalculating the sheet (and is the
reason for the Application.Volatile statement).

If you're not familiar with UDF's see

http://www.mvps.org/dmcritchie/excel/getstarted.htm



In article ,
"Gary" wrote:

I want to be able to determine whether the text in any given cell is bold,
and display that information as a true/false value in an adjoining cell.

Can you tell me how to accomplilsh this?

Thanks.