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
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
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
>
>
Hi WM,
You need to be a little more specific. Are performing a different 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 any colored cell in column A. I am also assuming that you have data in these cells. If not, the For loop will have to be changed as it will not pick up the upper limit.
If you are completely new to Excel and do not know how/where to put your VBA code, take a look at this site... Found this from a thread by 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 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?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks