Pagesetup.printarea is sooo slow

kdogg3000

New Member
Joined
Aug 30, 2006
Messages
1
Hi all, long time reader, 1st time poster...

Any way i can speed this up? I am copying an entire template sheet (by cells-see reason below) over to a new sheet, and then copying the printarea as well. My code runs through a lot of different functions and routines, but it seems to take a few (3~4) seconds for the printarea to set. (the rest of my code takes < 1 sec /per page it makes).

I've tried copying and renaming the template (which bypasses the problem), but then i am limited to only copying 50 sheets in one excel session (MS capabilities :( ) , and need the program to be robust enough for that not to occur. Any suggestions?

My current code sets a string to the template application.pagesetup.printarea, and then sets my new sheet up to the string.
Code:
Sub testing()
Dim s As String
s = ActiveSheet.PageSetup.printArea
sheets("XXX").PageSetup.printArea = s
End Sub

Anyone run into this or have any solutions?

THANKS!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Good evening kdogg3000

Welcome to the board!

Unfortunately, as you have found, copying settings across from one sheet to another does take quite a bit of time and the best thing is ... there's not much you can do about it :cry:

All you could do really is flash up a message in a userform or in the caption area telling the user that the settings are being copied and to be patient.

HTH

DominicB
 
Upvote 0
I was just looking at the Help File.

Would the following line allow you to achieve your desired results? It seems to me you would just need to select a cell within your print region just prior to running the line.

ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address
 
Upvote 0

Forum statistics

Threads
1,214,865
Messages
6,121,988
Members
449,060
Latest member
mtsheetz

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