Do not add hidden values to SUM

R

Roger Winkles

Anyone know of an easy way to only SUM visible rows in a
column of data? The only method I know of is to use
filters, and that is not an option.

Thanks,

Roger
 
D

Don Guillett

try
Sub subvis()
MsgBox Application.Sum(ActiveSheet.Columns("d").SpecialCells(xlVisible))
End Sub

as a function
Function subvisa(x)'Functions always go in regular modules
subvisa = Application.Sum(ActiveSheet.Columns(x).SpecialCells(xlVisible))
End Function
then on the worksheet =subvisa("d") for column D
 
Top