Hi Don,
This code doesn't give me the correct sum based on visible cells. I've
sumed up the regular values, hid a few columns, then sumed up the visible
values; yet, I still get the same total each time I run this macro. All of
my values are indeed within cell A1:A10 according to your example, but it
still didn't work. I'm trying to total only the visible cells and have it
shown in a cell.
Thanks,
Ricky
Don Guillett said:
try this
Sub sumvis()
mysum = 0
On Error Resume Next
For Each c In [a1:a10]
If c.EntireRow.Hidden <> True Then
mysum = mysum + c.Value
End If
Next
MsgBox mysum
End Sub
--
Don Guillett
SalesAid Software
Granite Shoals, TX
(e-mail address removed)
Ricky Pang said:
Hello,
I have numerous columns with subtotals. When a few columns are hidden,
what's the formula that activately adjusts itself to add only the visible
cells?
Much appreciated,
Ricky