Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,069
Default Counting bold cells in table rows

How do I create a formula to count the number of bold formatted cells in a
row using Excel 2003?


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,101
Default Counting bold cells in table rows

Im not sure there is a formula but vba could do just what you need.
Sub countBoldCells()
Const whatColumn = "A"
Const whatSheet = "Sheet1"
Dim xlWS As Worksheet
Dim lastRow As Long
Dim boldCounter As Long

Set xlWS = Worksheets(whatSheet)
lastRow = xlWS.Range(whatColumn & Rows.Count).End(xlUp).Row

boldCounter = 0
For r = 1 To lastRow
If xlWS.Range(whatColumn & r).Font.Bold = True Then
boldCounter = boldCounter + 1
End If
Next
MsgBox "There are " & boldCounter & " bold cells."
End Sub

"John" wrote:

How do I create a formula to count the number of bold formatted cells in a
row using Excel 2003?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Counting bold cells in table rows

You first need a UDF

Function CountBold(rg As Range) As Long
''originally posted by Ron Rosenfeld
Dim c As Range
For Each c In rg
CountBold = CountBold - c.Font.Bold
Next c
End Function

Usage is: =CountBold(range)


Gord Dibben MS Excel MVP

On Tue, 10 Jun 2008 17:31:01 -0700, John wrote:

How do I create a formula to count the number of bold formatted cells in a
row using Excel 2003?


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
Counting Last n Rows in Expanding Table [email protected] Excel Discussion (Misc queries) 9 October 29th 07 03:41 PM
Counting conditional cells in multiple rows RobDuB Excel Worksheet Functions 4 August 29th 07 09:42 PM
Pivot Table - Is counting all rows [email protected] Excel Discussion (Misc queries) 1 March 16th 07 08:12 PM
Counting Non-Zero Cells in a Pivot Table Moz Excel Discussion (Misc queries) 0 July 30th 06 01:55 PM
conditional counting of autolist cells/rows johli Excel Discussion (Misc queries) 0 September 23rd 05 01:45 PM


All times are GMT +1. The time now is 10:51 AM.

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

About Us

"It's about Microsoft Excel"