ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Counting by colour dilemma!! (https://www.excelbanter.com/excel-programming/316260-counting-colour-dilemma.html)

Simon Lloyd[_610_]

Counting by colour dilemma!!
 

Dave,

If i step thru the whole process (F8) when it has finished with th
Count By Color and moves on to the cell B6 and starts to use th
cntbycolor it reads the first 3 lines and then starts the Count B
Color function again returning a value of 0, i can post or send th
excel file to you if you wish with a short explanation.

simon


Dim Rng1 As Range
Application.Volatile True
Rng1 = Range("D14:AI491")
For Each Rng1 In InRange.Cells
If Rng1.Value = "#N/A" Then
'do nothing
Else
If IsNumber = True Then
CntByColor = CntByColor - _
(Rng.Font.ColorIndex = WhatColorIndex)
Else
CntByColor = CntByColor - _
(Rng.Interior.ColorIndex = WhatColorIndex)
End If
End I

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=27633


Dave Peterson[_5_]

Counting by colour dilemma!!
 
I like to keep the discussions in the newsgroups.

You'll usually get a faster response and lots of people will check the solution
and suggest alternatives.

But for that to work, I think you're going to have to post the current versions
of both functions and tell how they're invoked. Do you put the formula in cell
on a worksheet--or what?



Simon Lloyd wrote:

Dave,

If i step thru the whole process (F8) when it has finished with the
Count By Color and moves on to the cell B6 and starts to use the
cntbycolor it reads the first 3 lines and then starts the Count By
Color function again returning a value of 0, i can post or send the
excel file to you if you wish with a short explanation.

simon

Dim Rng1 As Range
Application.Volatile True
Rng1 = Range("D14:AI491")
For Each Rng1 In InRange.Cells
If Rng1.Value = "#N/A" Then
'do nothing
Else
If IsNumber = True Then
CntByColor = CntByColor - _
(Rng.Font.ColorIndex = WhatColorIndex)
Else
CntByColor = CntByColor - _
(Rng.Interior.ColorIndex = WhatColorIndex)
End If
End If

--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=276337


--

Dave Peterson


All times are GMT +1. The time now is 10:32 PM.

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