ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Performing actions on multiple worksheets (https://www.excelbanter.com/excel-programming/327720-performing-actions-multiple-worksheets.html)

[email protected]

Performing actions on multiple worksheets
 
Hi,

I would like to add the functionality to select any number of
worksheets in my workbook and then make small changes to the footer of
each page.

The code to change the footer is no problem, but i can't work out how
to get Excel to perform this code on multiple worksheets. There needs
to be the ability to select random numbers of worksheets, for example
sometimes i want to select sheets 1,2 and 6; other time i may want to
select sheers 2,3,6,8 and 23.

Can anyone think of a way in which this can be achieved.

Many thanks,
Chris


Tom Ogilvy

Performing actions on multiple worksheets
 
Dim sh as object
for each sh in Application.ActiveWindow.SelectedSheets
sh.PageSetup.LeftFooter = "ABCD"
Next

--
Regards,
Tom Ogilvy

wrote in message
ups.com...
Hi,

I would like to add the functionality to select any number of
worksheets in my workbook and then make small changes to the footer of
each page.

The code to change the footer is no problem, but i can't work out how
to get Excel to perform this code on multiple worksheets. There needs
to be the ability to select random numbers of worksheets, for example
sometimes i want to select sheets 1,2 and 6; other time i may want to
select sheers 2,3,6,8 and 23.

Can anyone think of a way in which this can be achieved.

Many thanks,
Chris





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

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