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 return the total from the visible, non blank cells that satisfies multiple conditions.
* You can use the add-in AVERAGEVISIBLE function to return the average value from the visible, non blank cells.
* You can use the add-in COUNTVISIBLE function return the number of visible, non blank cells in a range.
* You can use the add-in MAXVISIBLE function to return the largest value from the visible, non blank cells.
* You can use the add-in MINVISIBLE function to return the smallest value from the visible, non blank cells.
|
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