![]() |
page setup in multiple worksheets
I have a worksheet with about 70 tabs. Each tab is labeled with last names.
I want to change the page setup for all of them tothe following settings: Landscape, 58% fitting and zero margins al around. I setup a macro but that means I have to go to each tab and execute it, is there a way to automate the process to run it for all tabs instead of one by one? Thanks in advance. |
page setup in multiple worksheets
For Each sht In Sheets
With sht.PageSetup .Orientation = xlLandscape .Zoom = 58 End With End Sub "Jerry" wrote: I have a worksheet with about 70 tabs. Each tab is labeled with last names. I want to change the page setup for all of them tothe following settings: Landscape, 58% fitting and zero margins al around. I setup a macro but that means I have to go to each tab and execute it, is there a way to automate the process to run it for all tabs instead of one by one? Thanks in advance. |
page setup in multiple worksheets
Do you have to use a macro?
There are lots of page setup settings that you can change with the worksheets grouped that will change each of the sheets. Rightclick on any tab and select Select all sheets. change the settings rightclick and ungroup the sheets Almost any change you make to the activesheet in that group will be reflected on the other sheets--so it can be dangerous! If you have to use a macro, I'd still loop through them: Dim wks as worksheet for each wks in activeworkbook.worksheets wks.select 'your code here next wks Jerry wrote: I have a worksheet with about 70 tabs. Each tab is labeled with last names. I want to change the page setup for all of them tothe following settings: Landscape, 58% fitting and zero margins al around. I setup a macro but that means I have to go to each tab and execute it, is there a way to automate the process to run it for all tabs instead of one by one? Thanks in advance. -- Dave Peterson |
page setup in multiple worksheets
Thanks Joel, couple of minor changes and is working like a charm.
"Joel" wrote: For Each sht In Sheets With sht.PageSetup .Orientation = xlLandscape .Zoom = 58 End With End Sub "Jerry" wrote: I have a worksheet with about 70 tabs. Each tab is labeled with last names. I want to change the page setup for all of them tothe following settings: Landscape, 58% fitting and zero margins al around. I setup a macro but that means I have to go to each tab and execute it, is there a way to automate the process to run it for all tabs instead of one by one? Thanks in advance. |
page setup in multiple worksheets
I tried both approaches and I see your point of using one or the other.
Either way both of have have been helpful. "Dave Peterson" wrote: Do you have to use a macro? There are lots of page setup settings that you can change with the worksheets grouped that will change each of the sheets. Rightclick on any tab and select Select all sheets. change the settings rightclick and ungroup the sheets Almost any change you make to the activesheet in that group will be reflected on the other sheets--so it can be dangerous! If you have to use a macro, I'd still loop through them: Dim wks as worksheet for each wks in activeworkbook.worksheets wks.select 'your code here next wks Jerry wrote: I have a worksheet with about 70 tabs. Each tab is labeled with last names. I want to change the page setup for all of them tothe following settings: Landscape, 58% fitting and zero margins al around. I setup a macro but that means I have to go to each tab and execute it, is there a way to automate the process to run it for all tabs instead of one by one? Thanks in advance. -- Dave Peterson |
All times are GMT +1. The time now is 02:16 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com