Dynamically changing print areas for Pivot Tables

G

Guest

I have several pivot tables that expand and contract with data. I am
constantly changing print areas to accomodate all the data or to make sure
the data prints in a nice format on a single sheet.

Does anyone know how a macro could be set up that could print any data that
is continuously present in rows or columns? I'm an advanced excel user, but
not a programmer. I can record macros, and write very, very basic macro code.

Any help would be greatly appreciated.

Todd.
 
D

Debra Dalgleish

You could use code similar to the following:

'====================
Sub SetPrintArea()
With ActiveSheet
.PageSetup.PrintArea = _
.PivotTables(1).TableRange2.Address
End With

End Sub
'================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top