Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
counting formatted cells in vba
Can anyone help with this? i am trying to count all cells in one colum
formatted a certain colour, here is what i have...it counts all th cells until the date i have given it and returns that figure but is no singling out the certain coloured ones....hope you can help! Sub colorcount() ' ' colorcount Macro ' Macro recorded 22/04/04 by simon ' ' Keyboard Shortcut: Ctrl+Shift+k Dim ccount As Integer Range("a9").Select Do Until ActiveCell = "31/12/2004" ActiveCell.Offset(1, 0).Select Select Case ActiveCell.Offset(0, 0).FormatConditions.Count Case Is = ColorIndex = 38 ccount = ccount + 1 End Select Loop MsgBox "There Are " & ccount & " Holiday Clashes" End Sub Simon -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
counting formatted cells in vba
Take a look at Chip Pearson's site:
http://www.cpearson.com/excel/CFColors.htm He has some code there that'll do what you want. But if I were the developer of the workbook, then I'd know what those conditional formatting formulas/rules were. I'd try to use those same rules in code. To me, it's a lot simpler. "Simon Lloyd <" wrote: Can anyone help with this? i am trying to count all cells in one column formatted a certain colour, here is what i have...it counts all the cells until the date i have given it and returns that figure but is not singling out the certain coloured ones....hope you can help! Sub colorcount() ' ' colorcount Macro ' Macro recorded 22/04/04 by simon ' ' Keyboard Shortcut: Ctrl+Shift+k Dim ccount As Integer Range("a9").Select Do Until ActiveCell = "31/12/2004" ActiveCell.Offset(1, 0).Select Select Case ActiveCell.Offset(0, 0).FormatConditions.Count Case Is = ColorIndex = 38 ccount = ccount + 1 End Select Loop MsgBox "There Are " & ccount & " Holiday Clashes" End Sub Simon. --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
A UDF for Counting Coloured Cells that are conditionally formatted | New Users to Excel | |||
Counting specific formatted cells | Excel Discussion (Misc queries) | |||
Counting conditionally formatted cells | Excel Worksheet Functions | |||
Counting colour formatted cells | Excel Worksheet Functions | |||
Converting 'General' formatted cells to Text formatted cell using. | Excel Worksheet Functions |