![]() |
How to get Total of Coloured Cell in a Colum and Worksheet
How I get total of highlighted/Coloured Cell in a Colum .
How to get total of highlighted/coloured Cell in a Worksheet. |
How to get Total of Coloured Cell in a Colum and Worksheet
Hi
A couple of questions spring to mind - Are all the coloured cells the same colour? You could use a VBA routine to count the number of coloured cells. Below is the code I used in a standard VBA module.This assumes that there are no blank cells in the range. Sub countColouredCells() Dim wb As Workbook Dim ws As Worksheet Dim rg As Range Dim i As Integer Set wb = ThisWorkbook Set ws = wb.Worksheets(1) Set rg = ws.Range("B1") i = 0 Do Until IsEmpty(rg) If rg.Interior.ColorIndex = 3 Then i = i + 1 Set rg = rg.Offset(1, 0) Else Set rg = rg.Offset(1, 0) End If Loop Debug.Print i End Sub "Qazi Ahmad" wrote: How I get total of highlighted/Coloured Cell in a Colum . How to get total of highlighted/coloured Cell in a Worksheet. |
How to get Total of Coloured Cell in a Colum and Worksheet
See http://www.xldynamic.com/source/xld.ColourCounter.html for a working
solution -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Qazi Ahmad" wrote in message ... How I get total of highlighted/Coloured Cell in a Colum . How to get total of highlighted/coloured Cell in a Worksheet. |
How to get Total of Coloured Cell in a Colum and Worksheet
Far better than my solution
"Bob Phillips" wrote: See http://www.xldynamic.com/source/xld.ColourCounter.html for a working solution -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Qazi Ahmad" wrote in message ... How I get total of highlighted/Coloured Cell in a Colum . How to get total of highlighted/coloured Cell in a Worksheet. |
How to get Total of Coloured Cell in a Colum and Worksheet
Dear
I want to clear my Question that in Selected Cell Range I have some colored cell not all selected raged full on colored cells. I use different colors in selected range. Now I want to count how many colored cell in range and what the total to different colors which I use. (Below mentioned VB Module, where it display Result ??) Ahmad "steve_doc" wrote: Hi A couple of questions spring to mind - Are all the coloured cells the same colour? You could use a VBA routine to count the number of coloured cells. Below is the code I used in a standard VBA module.This assumes that there are no blank cells in the range. Sub countColouredCells() Dim wb As Workbook Dim ws As Worksheet Dim rg As Range Dim i As Integer Set wb = ThisWorkbook Set ws = wb.Worksheets(1) Set rg = ws.Range("B1") i = 0 Do Until IsEmpty(rg) If rg.Interior.ColorIndex = 3 Then i = i + 1 Set rg = rg.Offset(1, 0) Else Set rg = rg.Offset(1, 0) End If Loop Debug.Print i End Sub "Qazi Ahmad" wrote: How I get total of highlighted/Coloured Cell in a Colum . How to get total of highlighted/coloured Cell in a Worksheet. |
All times are GMT +1. The time now is 05:19 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com