a way sum only columns not hidden?

T

Todd

I have a worksheet with many hidden columns. The columns I hide keep
changing. Is there a way to have column totals adjust to sum only the
columns showing?

TIA

Todd
 
F

Frank Kabel

Hi
only possible with VBA.
SUBTOTAL would work if you would hide rows with a filter
 
K

KL

I am sure there are better ways, but if not then you can try this UDF:

Function SumVisible(mySelection As Range)
Application.Volatile
For Each c In mySelection
If c.Rows(c.Row).Hidden = False And _
IsNumeric(c) Then mySum = mySum + c.Value
Next c
SumVisible = mySum
End Function

Regards,
KL
 
P

Peo Sjoblom

SUBTOTAL in 2003 will work for manually hiiden rows as well

=SUBTOTAL(109,Range)

for hidden rows

=SUBTOTAL(3,Range)

for filtered rows

Regards,

Peo Sjoblom
 
F

Frank Kabel

Hi Peo
agreed but I think the OP asked for hidden columns and for this it
would not work
 

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