Macro to set print area, select pivot table portion

srikanth_s

New Member
Joined
Sep 1, 2009
Messages
9
I have a workbook containing a sheet that lists several possible line items in a price quote, and a pivot table containing those items selected by the user to be displayed (using checkboxes and a report filter).

I want my users to have to do as little as possible to go from selecting the rows to include, to printing to pdf. As part of this, I'm wondering if there is code I could use to do the following:

1. Select the row labels in the pivot table (IE, not the part that says "Data Items Here" or something like that -- I'm not using that portion of the pivot table)

2. Change that selection to include four rows above (where I have custom headings)

3. Set the print area

Any help you could provide would be fantastic. Thanks so much in advance!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
If you can do it manually a macro will certainly do it.
Can you send a screen shot of the Pivot Table and inform about the area to print and the same for the fours rows above.
 
Upvote 0
PCL,

Thanks for your reply.

Here's a screenshot:
pivottablescreenshote.jpg


The highlighted portion is what I'd want to set as print area. Merci d'avance!
 
Upvote 0
Just to clarify, what I'd like to understand is not how to set the print area to the range shown in the screenshot -- instead I want the code to set the print area to the specified sections of the pivottable (which vary depending on user input).

I need some help with understanding how to select what I think is called the row ranges in this pivot table.
 
Upvote 0

Forum statistics

Threads
1,214,588
Messages
6,120,412
Members
448,960
Latest member
AKSMITH

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