Ty
2015-11-07 20:42:28 UTC
Attempt to use "For Each TCell In CountRange.SpecialCells(xlCellTypeVisible)" for my excel problem. It is not working.
Problem: Only want to count colored cells that are filtered. Do not want count the hidden rows/cells.
Do anyone have an answer to my problem?
Function CountByColor(ICol as integer, CountRange As Range)
Application.Volatile
Dim TCell As Range
For Each TCell In CountRange.SpecialCells(xlCellTypeVisible)
If ICol = TCell.value Then
CountByColor = CountByColor + 1
End If
Next TCell
End Function
Thanks,
Ty
Problem: Only want to count colored cells that are filtered. Do not want count the hidden rows/cells.
Do anyone have an answer to my problem?
Function CountByColor(ICol as integer, CountRange As Range)
Application.Volatile
Dim TCell As Range
For Each TCell In CountRange.SpecialCells(xlCellTypeVisible)
If ICol = TCell.value Then
CountByColor = CountByColor + 1
End If
Next TCell
End Function
Thanks,
Ty