ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Dynamically changing print areas for Pivot Tables (https://www.excelbanter.com/excel-discussion-misc-queries/105285-dynamically-changing-print-areas-pivot-tables.html)

Todd1

Dynamically changing print areas for Pivot Tables
 
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.

Debra Dalgleish

Dynamically changing print areas for Pivot Tables
 
You could use code similar to the following:

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

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

Todd1 wrote:
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.



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html



All times are GMT +1. The time now is 01:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com