Counting BOLD text

J

jake lamotta

Can anyone please advise me how I can count only the "BOLD"" text i
a column??? I cannot sort the column, it will mess up the integrity..
HELP??
 
D

Don Guillett

try

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

jake lamotta

I am sorry... I am a novice user and don't understand... is that vb
code??? If so how and where do I enter it?>
 
J

jake lamotta

here's more of what I am looking to do...

Column A has a range of 6 digit numbers in it... some 6 digit cells are
BOLDED and some cells are not... I am looking to have Column B COUNT
the number of bolded 6 digit numbers in Column A???
 
D

Don Guillett

Yes, it is code. The simplest way for you to do this is to
right click on the sheet tab>view code>copy/paste the code>SAVE
To modify as desired use this:

Sub countbold()
For Each c In Selection
if len(c)=6 then _
boldcount = boldcount + 1
Next
MsgBox boldcount
End Sub

or just a formula
=SUMPRODUCT((LEN(A1:A100)=6)*1)
 
Top