If bold formula

D_Spark

Board Regular
Joined
Feb 4, 2007
Messages
232
I have created a workbook and inserted a module in an attempt to show "TRUE" if the text in a cell is bold and "FALSE" if it isnt.

What I did was:
Press ALT + F11 to open the VBA window.
Click Insert - Module.
Entered



Code:
Public Function IsBold(c As Range) As Boolean
On Error GoTo Handler
IsBold = c.Font.Bold
Exit Function
Handler:
If Err.Number = 94 Then IsBold = True
End Function

I then used the IsBold function to test if a cell is bold.
=IF(ISBOLD(sheet1!A1),"TRUE","FALSE")


This works ok but when A1 is changed from BOLD to UNBOLD, the formula doesn't update and return the correct "TRUE" or "FALSE" text ?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,191,166
Messages
5,985,052
Members
439,936
Latest member
BSR

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top