S
slingsh0t
When a user wants to make a global update to the print setup in a
multi-tab workbook, they can group all the sheets, make the change, and
it reflects in each of the grouped tabs. I'm trying to replicate this
using VBA, but I can't make it work.
I've tried
ActiveWorkbook.Sheets.Select
Sheets("Home").Activate 'tried it with and without this line
With ActiveSheet.PageSetup
.setup parameters snipped
End With
.... but this changes only the first of the grouped tabs.
I've written code that changes each tab's setup individually, but that
takes 80 to 90 seconds to run.
In desperation I recorded the steps in a macro, which derives this code
to group tabs:
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Since the number and names of tabs will vary from user to user, I wrote
code to recreate the list of tab names with quotes, commas, and spaces
then using the variable name in that syntax, like this
Sheets(Array(TabNamesList)).Select
.... to no avail- it generates an error.
What is the syntax to replicate the process of manually grouping tabs?
Thanks!
multi-tab workbook, they can group all the sheets, make the change, and
it reflects in each of the grouped tabs. I'm trying to replicate this
using VBA, but I can't make it work.
I've tried
ActiveWorkbook.Sheets.Select
Sheets("Home").Activate 'tried it with and without this line
With ActiveSheet.PageSetup
.setup parameters snipped
End With
.... but this changes only the first of the grouped tabs.
I've written code that changes each tab's setup individually, but that
takes 80 to 90 seconds to run.
In desperation I recorded the steps in a macro, which derives this code
to group tabs:
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Since the number and names of tabs will vary from user to user, I wrote
code to recreate the list of tab names with quotes, commas, and spaces
then using the variable name in that syntax, like this
Sheets(Array(TabNamesList)).Select
.... to no avail- it generates an error.
What is the syntax to replicate the process of manually grouping tabs?
Thanks!