countif if its bolded

  • Thread starter Thread starter MR
  • Start date Start date
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.
 
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 **
 
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
 
Back
Top