Condontionally format bold cells

G

Guest

I have a spreadsheet with the bold text in some cells. Regardless of the
content of these cells i would like to colour all cells with bold formatting
red.

Is this possible? If so, could you tell me how.

Thank you in advance for your assistance.

LittleNic71

If relevant, i am using Excel 2003.
 
D

Dave Peterson

You could create your own user defined function (UDF) that looks at the format
of the cell:

Option Explicit
Function isBold(rng As Range) As Variant

application.volatile

If rng(1).Font.Bold Then
isBold = True
ElseIf IsNull(rng(1).Font.Bold) Then
isBold = "Mixed"
Else
isBold = False
End If

End Function

Then you can use =isbold() in your formula in your conditional format formula

But be aware that changing the boldness of a cell is not something that causes
excel to recalculate. Hit alt-ctrl-F9 to force it recalc (before you trust the
results).

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

I'm not sure what should happen if you have some characters bold and others
not. The UDF returns Mixed and that's treated as false in the conditional
formatting. Change it to True or False to match what you want.
 
G

Guest

You can use Conditional Formatting to do that.

Select the cells you wish to conditionally format and do the following:

Click FORMAT in the menu and select CONDITIONAL FORMATTING

In the following dialog box, state the condition that determines whether or
not the cell if formatted in red/bold and then click the format button.
Select BOLD as the font style and directly below the style list, select the
color you wish to use. Click OK 2 times to return to the worksheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top