Build Macro to Print

estrauss22

New Member
Joined
Jul 5, 2007
Messages
32
I currently have a report that is feed by a pivot table. Each time you change the filter on the pivot table, new data comes up and alters the report. What I would like to do is be able to print a series of different reports, each with a different filter. I've tried to build a macro that would go through and select the various filters I want and print them, rather than having to manually select the filters each time I open the file. The problem I am having is that whenever I initiate the macro, it will not clear what was already selected in the report. I have various people, printing various reports and each time they print, whatever data was last loaded by the previous user is present on the new report as well. Is there a code I can write that would allow me to start with a clear pivot table each time?
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

estrauss22

New Member
Joined
Jul 5, 2007
Messages
32
When I do the clear contents code - it deletes the entire page (included the pivot table) I need to keep the pivot, clear the filters, and start fresh.
 
Upvote 0

ravishankar

Well-known Member
Joined
Feb 23, 2006
Messages
3,566
Hi
I gave a hypothetical range as A1:Z250. You have adjust it to delete what you don't need. I wouldn't have a clue where your pivot tables appear.
Ravi
 
Upvote 0

Forum statistics

Threads
1,186,363
Messages
5,957,418
Members
438,304
Latest member
duck90

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
Top