Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatically Changing the Print Area for Pivot Tables
I would like Excel to automatically adjust the print area for a pivot table.
As I select different options, the # of rows change and I have to manually select the print area to receive the correct printout. I found one other post about this and I tried to follow the instructions but I couldn't get it to work. I think I had to write a macro but I'm not sure. This was what the other thread suggested: dim i as long dim j as long dim rng as range set rng=range("b1..e1") ' the address of first row of data you want to print out j=0 for i = 1 to rng.columns.coun j=worksheetfunction.max(j,rng.cells(application.Ro ws.Count-rng.Row,1).end(xlup).row) next i activesheet.pagesetup.printarea = rng.Resize(j-rng.row+1,rng.Columns.Count).Address I consider myself to be an advanced user in Excel but I'm not good with writing code. I can record a new macro, no problem -- but I'm a novice at writing one. If you have a solution to this problem, please write the instructions for a "dummy". I won't take it personally :) I am using Excel 2003. -- Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Plot Area Automatically Expands in Print and Print Preview | Charts and Charting in Excel | |||
Dynamically changing print areas for Pivot Tables | Excel Discussion (Misc queries) | |||
Macro - Set Print Area for Changing Data Area | Excel Programming | |||
Create a print macro that would automatically select print area? | Excel Worksheet Functions | |||
Changing print area | Excel Discussion (Misc queries) |