If statement on format

eyeldham

New Member
Joined
Jan 2, 2003
Messages
49
Can an if statement evaluate the format of a cell?

Could it return one result if the cell is highlighted in bold (or a colour) whilst returning another if it is unformatted?

Used if statements a lot but this would be a help if it could achieve this.

Ed
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi Ed,

You can do this with VBA, but not with excel functions (unless you create a UDF of course).

Code:
Function isBold(myCell As Range) As Variant
    Select Case myCell.Font.Bold
        Case True
            isBold = True
        Case False
            isBold = False
    End Select
End Function

=isBold(A1)

Note, this will only work for one cell at a time.
 
Upvote 0
If you're using conditional formatting, you can use the same conditions to get the result you want.
 
Upvote 0

Forum statistics

Threads
1,214,424
Messages
6,119,404
Members
448,893
Latest member
AtariBaby

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
Back
Top