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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
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,224,823
Messages
6,181,178
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