Hello,
I use the code below to count cells with a certain fill color and when they are empty.
When i try this in an empty sheet it works perfectly but when i implement this into a big sheet where the sollution is for i get a #VALUE error.
There is no error in the range so that cannot be the problem. I know it is hard to find a sollution when the real workbook isn't provided but i realy can't upload that.
Does anyone know what can trigger this error? I added a example sheet if the cell count sollution isn't clear to anyone.
TX!
![]()
Public Function CountCells(RNG As Range) As Double Application.Volatile For Each CL In RNG If IsEmpty(CL) = True Then With CL.Interior If .Pattern = xlSolid And .Color = RGB(146, 205, 220) Then CountCells = CountCells + 1 End If End With End If Next CL End Function











LinkBack URL
About LinkBacks
Register To Reply
Bookmarks