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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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