Faster Way to Subtotal with VBA?

mnty89

Board Regular
Joined
Apr 1, 2016
Messages
66
Hey everyone,

I have a macro that contains a series of subtotaling based on criteria, and it seems to add the most time to the entire macro to execute. It is a decent set of data, 500-700 rows at a time, and subtotaling several things in succession. Is there a command to do it faster than the method used currently? Is there a more efficient command to replicate this? Does subtotaling get time consuming on macros?

I have calculation to manual, screen updating off etc before this kicks in so it should help as well.

Columns("B:N").Select
Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(12, 13), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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
Back
Top