LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Count by fiil color

I am trying to do a Lotto 649 sheet which marks each number you get b
filling in the block with a fill color, and also at the end of the ro
give a count how many numbers you have.
I have tried to do this but I can only get one or the other to work.
I can't get the two formulas to work together on one sheet
Below are the formulas

Formula 1 - =CountColor($A$2,B3:K3)

Code
Function CountColor(rColor As Range, rSumRange As Range)

''''''''''''''''''''''''''''''''''''''
'Written by Ozgrid Business Applications
'www.ozgrid.com

'Counts cells based on a specified fill color.
'''''''''''''''''''''''''''''''''''''''
Dim rCell As Range
Dim iCol As Integer
Dim vResult

iCol = rColor.Interior.ColorIndex

For Each rCell In rSumRange
If rCell.Interior.ColorIndex = iCol Then
vResult = vResult + 1
End If
Next rCell

CountColor = vResult
End Function

Formula 2 -
Choose Format|Conditional Formatting
From the first dropdown, choose Formula Is
For the formula, use the CountIf function:
=COUNTIF($A$45:$K$49,B3)
Click the Format button.
Select formatting options (green pattern,), click OK
Click OK

Thanks Keit

--
Message posted from http://www.ExcelForum.com

 
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
count color cell reza Excel Discussion (Misc queries) 2 August 13th 09 09:44 AM
Count, Sum, and Filter by Color Khalil[_2_] Excel Worksheet Functions 3 June 19th 09 05:06 PM
Can you count cells by color? TM Excel Worksheet Functions 3 September 6th 07 12:12 AM
using vba to do a count for color cell tikchye_oldLearner57 Excel Discussion (Misc queries) 2 April 12th 07 02:32 AM
Fiil Color Fixed Spacing Earl Excel Discussion (Misc queries) 3 January 8th 07 05:36 PM


All times are GMT +1. The time now is 03:01 AM.

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"