Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have data in a column from A2 down to around A800. The data is filtered by
auto filter. I can get the sum of the visible data with =SUBTOTAL(109,A1:A1000). This works just fine. Now I want to get the sum of only the last 7 visible values. Problem is that I dont know how to put in the range because I dont know it until after the filter is applied. This is probably very easy, but excel help for subtotal does not cover it. -- jake |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub sumlastSevenvisible()
mc = 1 On Error Resume Next For i = Cells(Rows.Count, mc).End(xlUp).row To 1 Step -1 If Rows(i).Hidden = False Then mycount = mycount + 1 mysum = mysum + Cells(i, mc) If mycount = 7 Then Exit For End If Next i MsgBox mysum End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Jakobshavn Isbrae" wrote in message ... I have data in a column from A2 down to around A800. The data is filtered by auto filter. I can get the sum of the visible data with =SUBTOTAL(109,A1:A1000). This works just fine. Now I want to get the sum of only the last 7 visible values. Problem is that I dont know how to put in the range because I dont know it until after the filter is applied. This is probably very easy, but excel help for subtotal does not cover it. -- jake |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro excel subtotal in subtotal | Excel Discussion (Misc queries) | |||
How do I Subtotal, then Sort by Subtotal Amounts? | Excel Discussion (Misc queries) | |||
pasting to subtotal lines without replacing hidden -non-subtotal l | Excel Discussion (Misc queries) | |||
Bolding the subtotal lines automaticlly When using the Subtotal fu | New Users to Excel | |||
Subtotal of Subtotal displays Grand Total in wrong row | Excel Worksheet Functions |