Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to Count only Colored cells


I'm new to Excel, but I've been asked to create a worksheet that ha
colored cells showing when a project is completed. My problem is
need to do a "count" on the completed(colored cells). How can I d
this?

Thanks for any help...
Wm_195

--
WM_195
-----------------------------------------------------------------------
WM_1956's Profile: http://www.excelforum.com/member.php...fo&userid=2989
View this thread: http://www.excelforum.com/showthread.php?threadid=49603

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default How to Count only Colored cells

See:

http://www.xldynamic.com/source/xld.ColourCounter.html


--
Gary''s Student


"WM_1956" wrote:


I'm new to Excel, but I've been asked to create a worksheet that has
colored cells showing when a project is completed. My problem is I
need to do a "count" on the completed(colored cells). How can I do
this?

Thanks for any help...
Wm_1956


--
WM_1956
------------------------------------------------------------------------
WM_1956's Profile: http://www.excelforum.com/member.php...o&userid=29895
View this thread: http://www.excelforum.com/showthread...hreadid=496032


  #3   Report Post  
Posted to microsoft.public.excel.programming
jtp jtp is offline
external usenet poster
 
Posts: 1
Default How to Count only Colored cells


Hi WM,
You need to be a little more specific. Are performing a differen
count on each color or just any color? Also are you going by just row
column or an entire worksheet? The procedure below will count an
colored cell in column A. I am also assuming that you have data i
these cells. If not, the For loop will have to be changed as it wil
not pick up the upper limit.

If you are completely new to Excel and do not know how/where to pu
your VBA code, take a look at this site... Found this from a thread b
Norman Jones

David McRitchie's 'Getting Started With Macros And
User Defined Functions' at:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


You might also look at David's tutorials page at:

http://www.mvps.org/dmcritchie/excel....htm#tutorials

The VBA material is towards the end of that section.

-Sub CountColoredCells()
Dim cell As Range, i As Integer, totals As Integer

Set cell = Range("A1")

totals = 0
For i = 0 To Range("A1").End(xlDown).Row - 1
If cell.Offset(i, 0).Interior.ColorIndex < xlNone Then
totals = totals + 1
End If
Next
cell.Offset(i, 0).Value = totals

End Sub-
Hope this helps some,

Jason


I'm new to Excel, but I've been asked to create a worksheet that ha
colored cells showing when a project is completed. My problem is I nee
to do a "count" on the completed(colored cells). How can I do this

--
jt
-----------------------------------------------------------------------
jtp's Profile: http://www.excelforum.com/member.php...fo&userid=2113
View this thread: http://www.excelforum.com/showthread.php?threadid=49603

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
VBA to count colored cells ericahughes Excel Worksheet Functions 1 February 9th 10 08:55 PM
How do you count colored cells? Clueless78217 Excel Worksheet Functions 2 November 25th 08 04:35 AM
count colored cells? DKY Excel Worksheet Functions 21 January 19th 06 09:47 PM
Count non-colored cells Ken G Excel Discussion (Misc queries) 3 January 2nd 05 12:42 PM
Count or sum colored cells brightgirl Excel Worksheet Functions 2 December 7th 04 03:34 PM


All times are GMT +1. The time now is 11:04 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"