countif if its bolded

M

MR

I have a column with values. Some values are bolded, some are not.

I want to count how many are bolded.

How?

Thanks.
 
P

Paul B

MR, here is one way, select your range and run this macro

Sub count_bold()
For Each c In Selection
If c.Font.Bold = True Then _
boldcount = boldcount + 1
Next
MsgBox boldcount

'*****or this to put the count in A1***
'[A1] = boldcount

End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
 
G

Gord Dibben

MR

How did the values get bolded? Manually or by Conditional Formatting?

If manually, Paul's code will count them.

If via CF, you will need additional code or COUNTIF on the condition(s) that
bolded the values.

See Chip Pearson's site for more info on this subject.

http://www.cpearson.com/excel/CFColors.htm

Gord Dibben Excel MVP
 

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