code for sum data after filter each time

sakijung

Board Regular
Joined
Jan 12, 2004
Messages
75
Good morning. I have a problem with sum in autofilter on my report in excel. I have a report for my curriculum in school. I used the formula =subtotal(9,xxx) every time that I filtered. I must to change the formula about the range. For example 1st time is =subtotal(9,a2:a8), 2nd is (9,a9:a20) and the range of cell is up to the curriculum and they are not constant. I would like some code or macro for summing the data after we filtered them.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
sakijung said:
Good morning. I have a problem with sum in autofilter on my report in excel. I have a report for my curriculum in school. I used the formula =subtotal(9,xxx) every time that I filtered. I must to change the formula about the range. For example 1st time is =subtotal(9,a2:a8), 2nd is (9,a9:a20) and the range of cell is up to the curriculum and they are not constant. I would like some code or macro for summing the data after we filtered them.

Why is it A2:A8 then A9:A20?
 

Forum statistics

Threads
1,147,626
Messages
5,742,214
Members
423,714
Latest member
ftp2jz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top