Speeding Up a Macro to control selections in a Slicer

SpikeGiles

New Member
Joined
Oct 27, 2011
Messages
17
I have a huge data set of sales by different product categories. Each category has a code and there is a large list of codes. I have a slicer to select the set of codes I wish to report on at any given time and I have created different macros to select different groups of codes for different reporting purposes. The VBA code that is generated by these macros lists every code in my data set with either a true or false attached, determining if that code is selected or not. Trouble is when I run a macro it seems to evaluate each code one at a time and refresh the report for each code. This causes the macro to take a inordinate amount of time to run. Is there a way to have the macro make all the selections in the slicer, but only update the report after all the codes have been either selected or not?
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I have a huge data set of sales by different product categories. Each category has a code and there is a large list of codes. I have a slicer to select the set of codes I wish to report on at any given time and I have created different macros to select different groups of codes for different reporting purposes. The VBA code that is generated by these macros lists every code in my data set with either a true or false attached, determining if that code is selected or not. Trouble is when I run a macro it seems to evaluate each code one at a time and refresh the report for each code. This causes the macro to take a inordinate amount of time to run. Is there a way to have the macro make all the selections in the slicer, but only update the report after all the codes have been either selected or not?

Would need to see the code, but you most likely need to turn off screen updating, and possibly events until you're done processing.
 
Upvote 0

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

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