Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I am having the following formula to count on the basis of colour. For example
Total 12 cell out of which Red - 1, Yellow - 5 & Green - 6 so by using this formula this should give proper count as mentioned above. I need you assistance as i have never used macro using VBA in Microsoft Excel. Could you please guide me (Step by Step) how to run this macro in excel. Appreciate your kind assistance. Thanks in advance. Kamlesh Function CountByColor(InputRange As Range, ColorRange as Range) As Long Dim cl As Range, TempCount As Long, ColorIndex As Integer ColorIndex = ColorRange.Cells(1, 1).Interior.ColorIndex TempCount = 0 For Each cl In InputRange.Cells If cl.Interior.ColorIndex = ColorIndex Then TempCount = TempCount + 1 End If Next cl Set cl = Nothing CountByColor = TempCount End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Export to Microsoft Excel from IE | Excel Discussion (Misc queries) | |||
import payees from Excel into Microsoft Money 2006 | Excel Discussion (Misc queries) | |||
Excell VS Office | Excel Discussion (Misc queries) | |||
Microsoft Access Report into Excel Spreadsheet | Excel Discussion (Misc queries) | |||
How can I use count function in excel where I have several criter. | Excel Worksheet Functions |