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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top