Sum Bold and Visible

H

Harald Staff

Write a custom VBA function that tests for bold and visible and sums up the
content of those.

HTH. Best wishs Harald
 
G

Gord Dibben

Public Function SumVisBold(rngSumRange As Range) As Single
Dim rngCell As Range
For Each rngCell In rngSumRange
If IsNumeric(rngCell.Value) Then
If rngCell.Font.Bold = True Then
If rngCell.Rows.Hidden = False Then
If rngCell.Columns.Hidden = False Then
SumVisBold = SumVisBold + rngCell.Value
End If
End If
End If
End If
Next rngCell
End Function

Note: you will have to force a re-calc


Gord Dibben MS Excel MVP
 
Top