I have a list of numbers, some coloured and others not. I need a formula to count the number of coloured cells as there is a large amount of numbers. Any help please
I have a list of numbers, some coloured and others not. I need a formula to count the number of coloured cells as there is a large amount of numbers. Any help please
Last edited by ukphoenix; 10-29-2012 at 11:13 AM.
How did the numbers get colored in the first place?
HTH
Regards, Jeff
manually, but may well work on another process. only a few numabers are entered weekly which makes it managable, but need a tally at end of month and year
as an addition can a formula be used to create another worksheet with matching numbers from month.
example (hopefully)
i have 3 worksheets with numbers 1 to 10000 on each of them numbers 1,5,7 on sheet1, 2,5,7 on sheet2, 3,5,4 on sheet3. Can a 4th sheet be produced to show that 5 shows on all and only 5, or is this moving into macros required?
Yes for this last question you need to post a seperate thread in the macros sub forum.
Try
![]()
Function COUNTCOLOR(rColor As Range, rCountRange As Range) Dim rCell As Range Dim iCol As Integer Dim Result Application.Volatile iCol = rColor.Interior.ColorIndex For Each rCell In rCountRange If rCell.Interior.ColorIndex = iCol Then Result = Result + 1 End If Next rCell '=COUNTCOLOR(A1,BZ18:CZ29) 'Where A1 houses the colour of choice (e.g. yellow) COUNTCOLOR = Result End Function
Now u have totally thrown me as i know macros excist but have no idea how to enter them in workbooks...lol.....complete novice when it comes to macros sorry. Any easy way of instructing me how to enter it id be most apprecaitive
No problem.
There are three types of macros: General, Sheet, and ThisWorkbook.
This is a general macro
- Copy macro from post above
- Select Ctrl + F11 (Opens VBE)
- Select Ctrl + R (Only if project tree on the left side of the screen is not open)
- Select Insert on toolbar >> Module
- Paste macro on right side of screen
- Select Alt + Q (Closes the VBE and return you to Excel)
Lets say your range is A1:H20 and the color you want to count first occurs in C3.
In a open cell enter =COUNTCOLOR(C3,A1:H20)
NOTE: A User Defined Function (UDF) will not recalculate all by itself; instead, Ctrl + Alt + F9
Ok sorted that now counts the coloured cells thanx. But what of the matching numbers through the sheets whats the macro for generating a 4th sheet say with a list of matching numbers?
Are you speaking of post #4?
If so, you need to create a new thread as it is a new topic.
ok thanx for ur help, cheers
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks