ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is there a fuction that counts number of highlighted cells Excell (https://www.excelbanter.com/excel-programming/401746-there-fuction-counts-number-highlighted-cells-excell.html)

bstrack

Is there a fuction that counts number of highlighted cells Excell
 
I want to total the number of highlighted or specific fill color cells in a
range. The data in the cell in not my concer just the highlight or fill.

joel

Is there a fuction that counts number of highlighted cells Excell
 
Call with below call. Note: The code below will not automatically update
when color get changed. Color changes do not cause a recalculation of the
spreadsheet.


=FilledCells(B7:D10)


Function FilledCells(Target As Range)
Count = 0
For Each Cell In Target
If Cell.Interior.ColorIndex < xlNone Then
Count = Count + 1
End If
Next Cell
FilledCells = Count
End Function"bstrack" wrote:

I want to total the number of highlighted or specific fill color cells in a
range. The data in the cell in not my concer just the highlight or fill.


JLGWhiz

Is there a fuction that counts number of highlighted cells Exc
 
Hi Joel, you didn't include the cell colored by conditional formatting. they
have to have the FormatCondidtions(1) thing thrown in like:

If Cell.FormatConditions(1).Interior.ColorIndex < xlNone

"Joel" wrote:

Call with below call. Note: The code below will not automatically update
when color get changed. Color changes do not cause a recalculation of the
spreadsheet.


=FilledCells(B7:D10)


Function FilledCells(Target As Range)
Count = 0
For Each Cell In Target
If Cell.Interior.ColorIndex < xlNone Then
Count = Count + 1
End If
Next Cell
FilledCells = Count
End Function"bstrack" wrote:

I want to total the number of highlighted or specific fill color cells in a
range. The data in the cell in not my concer just the highlight or fill.



All times are GMT +1. The time now is 06:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com