hello
this my version of summing only visible cells in a range:
[VBA]
Function sumonlyvisible(r As Range)
Application.Volatile
Dim cell As Range
For Each cell In r
If cell.Rows.Hidden = False Then
If cell.Columns.Hidden = False Then
sumonlyvisible = sumonlyvisible + cell.Value
End If
End If
Next
End Function
[/VBA]
i wanted to attach this macro to a button and place it along side the excel bulit in sum icon:
[VBA]
On Error Resume Next
Application.CommandBars("standard").Controls("sum visible").Delete
With Application.CommandBars("standard").Controls.Add(before:=24)
.Caption = "sum visible"
.faceid = 308
.Style = msoButtonIcon
.OnAction = ""
.BeginGroup = True
End With
[/VBA]
could it be doen?