ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Count cells according to format (https://www.excelbanter.com/excel-discussion-misc-queries/166695-count-cells-according-format.html)

scheduler

Count cells according to format
 
if i have a row of data, some in a normal font and others in BOLD, is it
possible to count how many cells use the BOLD format in the range?
--
scheduler

carlo

Count cells according to format
 
By formula or by VBA?

I'm sure, that it works with VBA, but I don't know if it is possible
with a Formula.

Carlo

On Nov 20, 1:23 pm, scheduler
wrote:
if i have a row of data, some in a normal font and others in BOLD, is it
possible to count how many cells use the BOLD format in the range?
--
scheduler



Gord Dibben

Count cells according to format
 
You could employ a user defined function.

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

=CountBold(A1:M1)

If you have Excel 2003(don't know about 2007)

You could try this alternate method which doesn't use VBA or any add-ins.

In 2003 you can specify the Format color to look for under
EditFindOptionsFormatFormat.

Select the Bold Font Type from the Font dialog and Find All.

In the found dialog box the first cell will be highlighted. Then SHIFT + End +
DownArrow to select all..

The selected cells can then be counted by right-click on Status Bar and "Count".


Gord Dibben MS Excel MVP

On Mon, 19 Nov 2007 20:23:01 -0800, scheduler
wrote:

if i have a row of data, some in a normal font and others in BOLD, is it
possible to count how many cells use the BOLD format in the range?




All times are GMT +1. The time now is 02:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com