ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Group All Sheets in a workbook (https://www.excelbanter.com/excel-programming/324492-group-all-sheets-workbook.html)

Michael Smith

Group All Sheets in a workbook
 
Anyone know the code to group all Sheets in a workbook??...trying to do
the same page setup on all sheets in a workbook and need to group them
together first.

TIA.
-mike


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

PaulD

Group All Sheets in a workbook
 

"Michael Smith" wrote in message
...
: Anyone know the code to group all Sheets in a workbook??...trying to do
: the same page setup on all sheets in a workbook and need to group them
: together first.
:
: TIA.
: -mike

Well, not sure exactly what you mean but there are several ways to select
worksheets.

You can use the sheets collection
Sheets.Select
to select all sheets

or you can iterate throught the collection
for each sh in sheets
...code here
next sh

you could array the sheets
Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4")).Select

I believe .pagesetup is a propert of worksheet only so you either need to
group them first then use activesheet or iterate
Paul




All times are GMT +1. The time now is 10:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com