Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Head Honcho
 
Posts: n/a
Default How do I ask Excel to count how many items are in BOLD TYPE?

HI...wondering how I can have Excel give me a total of how many words or
titles are typed with BOLD lettering in a particular column.

Can anyone help me, I'm going batty...

THANKS
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

There's nothing built into excel that will sum values based on formatting.

You could use a User defined function, though.

Option Explicit
Function CountBold(rng As Range) as Long

Application.Volatile

Dim myCell As Range
Dim myTotal As Long

myTotal = 0
For Each myCell In rng.Cells
With myCell
If .Font.Bold = True Then
myTotal = myTotal + 1
End If
End With
Next myCell

CountBold = myTotal

End Function

Be aware that changing formats won't cause excel to recalculate. You could be
one calculation cycle behind. I'd hit the calculate key (F9) before I trusted
the value in the cell.

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

Short course:

Open your workbook.
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel.
Into a test cell and type:
=CountBold(a1:a10)

You didn't ask, but Chip Pearson has similar routines based on colors. You may
want to look at that, too:

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

Head Honcho wrote:

HI...wondering how I can have Excel give me a total of how many words or
titles are typed with BOLD lettering in a particular column.

Can anyone help me, I'm going batty...

THANKS


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
How to count how many different items in one colum? Letizia Excel Worksheet Functions 1 April 7th 05 04:24 PM
Auto Email from Excel doesn't appear in Sent Items WimR Excel Discussion (Misc queries) 1 January 6th 05 12:18 AM
Count of unique items meeting condition Tim C Excel Worksheet Functions 1 November 12th 04 03:03 AM
How do I get a count when I filter an excel worksheet? Cheap50 Excel Worksheet Functions 1 November 11th 04 04:18 AM


All times are GMT +1. The time now is 11:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"