Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear Experts:
below macro counts the number of shaded cells in the selection. I wonder whether the below macro can be re-written to consider gradient fills as well, i.e. ... .... e.g. I got a gradient fill with two colors (light blue RGB 220, 230, 242 and dark blue RGB 79, 129, 189), the gradient pattern is horizontal. Help is much appreciated. Thank you very much in advance. Regards, Andreas Sub grey_count() Dim lastcell As Variant Dim firstcell As Variant Dim Cell As Range Dim x As Long lastcell = Cells.SpecialCells(xlCellTypeLastCell).Address firstcell = "A1" Range(firstcell & ":" & lastcell).Select For Each Cell In Selection If Cell.Interior.Color = RGB(234, 234, 234) Then x = x + 1 Next MsgBox x & " cells are grey (234, 234, 234)" End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula to count cells that contain a number & are not shaded | Excel Discussion (Misc queries) | |||
how do I count the number of gray-shaded cells within a range? | Excel Worksheet Functions | |||
How can I get a count of cells in a range that are shaded a certa. | Excel Worksheet Functions | |||
How do I count shaded cells | Excel Worksheet Functions | |||
Count number of shaded cells | Excel Discussion (Misc queries) |