SUMVISIBLE
SUMVISIBLE(rgeValues)
Returns the sum of values from the visible, non blank cells.
| rgeValues | The unit |
REMARKS
* This function excludes hidden cells caused by AutoFilter, Grouping or that have been Manually Hidden.
* You can use the built-in SUM function to include hidden cells.
* You can use the add-in SUMVISIBLEIFS function to
* You can use the add-in AVERAGEVISIBLE function to
* You can use the add-in COUNTVISIBLE function
* You can use the add-in MAXVISIBLE function to
* You can use the add-in MINVISIBLE function to
* You can use the user defined MEDIANVISIBLE function to
|
Public Function SUMVISIBLE( _
ByVal rgeValues As Range) _
As Double
Dim rgeCell As Range
Dim dbtotal As Double
Application.Volatile
For Each rgeCell In rgeValues
If (rgeCell.EntireRow.Hidden = False) And _
(rgeCell.EntireColumn.Hidden = False) Then
If (Len(rgeCell.Value) > 0) Then
If (rgeCell.Value <> "True") And _
(rgeCell.Value <> "False") And _
(Application.WorksheetFunction.IsText(rgeCell.Value) <> True) Then
dbtotal = dbtotal + rgeCell.Value
End If
End If
End If
Next rgeCell
SUMVISIBLE = dbtotal
End Function
Public Function SUMVISIBLE2( _
ByVal rgeValues As Range) _
As Double
Dim dbtotal As Double
dbtotal = Application.WorksheetFunction.Aggregate(9, 5, rgeValues)
SUMVISIBLE2 = dbtotal
End Function
© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext