Copy PageSetup

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Copy PageSetup

Post by jstevens »

Is it possible to copy a worksheets' PageSetup to another workbook/sheet?

Something like:
Workbooks("One").Sheets("Sheet1").PageSetup.Copy _
Destination:=Workbooks("Two").Sheets("Sheet1").PasteSpecial Paste:=PageSetup

Thanks,
John
Regards,
John

User avatar
HansV
Administrator
Posts: 78642
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Copy PageSetup

Post by HansV »

Within a workbook, you can apply page setup to multiple sheets, and this provides a way to copy page setup. But between workbooks, you'd have to store all page setup properties of the 'source' sheet in variables, then set the page setup properties of the 'target' sheet to those variables.
Best wishes,
Hans

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Copy PageSetup

Post by jstevens »

Hans,

That is what I expected.

Thank you,
John
Regards,
John

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Copy PageSetup

Post by jstevens »

Hans,

I'm encountering a challenge with the length of time it takes (using the page setup variables) to set the "target" sheet's page setup settings.

It's taking about 30-45 seconds to complete. I set the ScreenUpdating to False and Calculation to Manual but this does not help.

Any suggestions would be appreciated.
Regards,
John

User avatar
HansV
Administrator
Posts: 78642
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Copy PageSetup

Post by HansV »

Best wishes,
Hans

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Copy PageSetup

Post by jstevens »

Hans,

Thanks for the suggestion. It is a very interesting solution.

Regards,
John
Regards,
John