S
slingsh0t
I have a file that is shared with international users, and have written
code to change paper size from Letter to A4. The current version of
this code enters each sheet individually and changes paper size, but
takes 80 seconds +/- to run.
I've tried to revise it by unhiding sheets, grouping sheets, changing
paper size, then ungrouping sheets as in the code that follows, but
only the "Home" tab, which is the leftmost tab in the workbook, is
affected. The others are still in A4 size.
ActiveWorkbook.Sheets.Select
Sheets("Home").Activate 'tried it with and without this line
With ActiveSheet.PageSetup
.PaperSize = xlPaperLetter
End With
In the course of debugging I recorded a macro to compare my code, and
see that the recorder develops this:
Sheets(Array("Home", "Price & Revenue Control", "Cover Sheet")).Select
....but I can't figure out a way to duplicate that. I *thought* the
ActiveWorkbook.Sheets.Select line would provide that same
functionality, but apparently not.
Any thoughts? Thanks!
code to change paper size from Letter to A4. The current version of
this code enters each sheet individually and changes paper size, but
takes 80 seconds +/- to run.
I've tried to revise it by unhiding sheets, grouping sheets, changing
paper size, then ungrouping sheets as in the code that follows, but
only the "Home" tab, which is the leftmost tab in the workbook, is
affected. The others are still in A4 size.
ActiveWorkbook.Sheets.Select
Sheets("Home").Activate 'tried it with and without this line
With ActiveSheet.PageSetup
.PaperSize = xlPaperLetter
End With
In the course of debugging I recorded a macro to compare my code, and
see that the recorder develops this:
Sheets(Array("Home", "Price & Revenue Control", "Cover Sheet")).Select
....but I can't figure out a way to duplicate that. I *thought* the
ActiveWorkbook.Sheets.Select line would provide that same
functionality, but apparently not.
Any thoughts? Thanks!