Returns the number of visible non blank cells.
* This function excludes hidden cells.
* You can use the COUNT function to include hidden cells.
* For instructions on how to add a function to a workbook refer to the page under Inserting Functions
* You could also use aggregate(2,5,range)
Public Function COUNTVISIBLE( _
ByVal rgeValues As Range) As Integer
Dim rgeCell As Range
Dim itotalcells As Integer
For Each rgeCell In rgeValues
If (rgeCell.EntireRow.Hidden = False) And _
(rgeCell.EntireColumn.Hidden = False) Then
itotalcells = itotalcells + 1
COUNTVISIBLE = itotalcells
© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext