VBA to control multiple pivot tables

Harvey12

Board Regular
Joined
Feb 23, 2015
Messages
130
Hi All,

I am fairly new to VBA so if you could bare with me it would be much appreciated.

What I would like to achieve is the ability to change the date filter in a whole range of pivot tables in multiple different worksheets in increments of months which take the form of "mmm-yy" EG. APR-15 or May-15. I have around 25 pivot tables and it is fairly time consuming moving between tabs changing the dates at the end of the month.

I have looked for this previously and seen that slicers are an option - but my data does not all come from the same source so as far as I am aware it doesn't work.

Could someone please help me to start to write some form of Macro that changes all of the dates of the pivot tables in all of the worksheets but 1 month.

Or even better could I create a tab of which you type the desired month of choice in the same format (mmm-yy) as the table and this will then run the macro by pressing a button. This will in turn update all the tables to the desired month. Is this possible? Plus how will this be affected in years going forwards?

Any assistance would be very much appreciated.

Many thanks
Harvey
 
Hi Harvey,

You are not pestering me. There are a lot more folks helping me than I am helping.

I played with the macro and could not get it to exclude a pivot table, I tried using ranges and table names but nothing worked for me.

I did not wright the code I found it at contextures.com. I looked there and did not find anything to help with your problem.

I am pretty sure it can be done but it is going to take someone better with VBA than me to do it. I suggest starting a new thread with that question.

Sorry I cant be of any help.

Greg
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Greg,

Thanks for getting back to me so fast!

Okay not to worry I will start a new thread.

Thank you again for all your help!!
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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