Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 107
Default Worksheet formulas

What formula enables me to count the number of cells with a specific format?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Worksheet formulas

None.

Function CountEm(rng as range, cellFormat as string)
Dim cell As Range
For each cell in rng
If cell.numberformat = cellformat Then
CountEm = CountEm + 1
End If
Next cell
End Function

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Thomas" wrote in message
...
What formula enables me to count the number of cells with a specific
format?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Worksheet formulas

Hey Bob! I just noticed your code. I copied/pasted it into a VBA module and
tried to get it working, but was unable to do so. I tried the version that
Chip Pearson posed on his site:

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

This works well for me, but yours does not.

I colored cells A1:A2 & A4:A6, and colored cell C1 the same color (cells
A3:A4 are white).Then I placed =countem(A1:A6,C1) in E1 and I expected to see
a value of 4, but instead I got a value of 6. If you get a chance, please
explain how to €˜call your function.

Regards,
Ryan---
--
RyGuy


"Bob Phillips" wrote:

None.

Function CountEm(rng as range, cellFormat as string)
Dim cell As Range
For each cell in rng
If cell.numberformat = cellformat Then
CountEm = CountEm + 1
End If
Next cell
End Function

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Thomas" wrote in message
...
What formula enables me to count the number of cells with a specific
format?




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Worksheet formulas

This was not for cell colour, but cell formats.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"ryguy7272" wrote in message
...
Hey Bob! I just noticed your code. I copied/pasted it into a VBA module
and
tried to get it working, but was unable to do so. I tried the version
that
Chip Pearson posed on his site:

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

This works well for me, but yours does not.

I colored cells A1:A2 & A4:A6, and colored cell C1 the same color (cells
A3:A4 are white).Then I placed =countem(A1:A6,C1) in E1 and I expected to
see
a value of 4, but instead I got a value of 6. If you get a chance, please
explain how to 'call' your function.

Regards,
Ryan---
--
RyGuy


"Bob Phillips" wrote:

None.

Function CountEm(rng as range, cellFormat as string)
Dim cell As Range
For each cell in rng
If cell.numberformat = cellformat Then
CountEm = CountEm + 1
End If
Next cell
End Function

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Thomas" wrote in message
...
What formula enables me to count the number of cells with a specific
format?






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 - Linking Formulas, Worksheet to Worksheet windsong Excel Discussion (Misc queries) 4 November 15th 05 03:10 PM
Linking Formulas, Worksheet to Worksheet - Excel 2003 windsong Excel Discussion (Misc queries) 2 November 14th 05 01:37 AM
Automatically pasting worksheet data to new worksheet with formulas COntactJason Excel Worksheet Functions 0 August 10th 05 08:22 PM
copying formulas from worksheet to worksheet yesbob Excel Discussion (Misc queries) 1 February 7th 05 02:25 AM
Formulas appear on worksheet Ken White Excel Worksheet Functions 2 January 30th 05 04:47 PM


All times are GMT +1. The time now is 07:38 PM.

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"