Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've got many sheets that have the same left header but all have
different right header sections and different footers. I'd like to create code that makes the same change to the left header of all the sheets BUT leaves the rest of the header, and footer, alone. Is this possible? I don't want to edit code for each of the sheets - that's why I'm looking for the magical "leave the rest alone" snippet. Is it anywhere? Thank you for advice! -- Paul Cross |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
try sub change_left_header() dim wks as worksheets for each wks in activeworkbook.worksheets with wks.pagesetup .leftheader = "your new header" end with next end sub -- Regards Frank Kabel Frankfurt, Germany Paul Cross wrote: I've got many sheets that have the same left header but all have different right header sections and different footers. I'd like to create code that makes the same change to the left header of all the sheets BUT leaves the rest of the header, and footer, alone. Is this possible? I don't want to edit code for each of the sheets - that's why I'm looking for the magical "leave the rest alone" snippet. Is it anywhere? Thank you for advice! -- Paul Cross |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you kindly. This appeared to work for me after dropping the 's'
in the declaration line ("dim wks as worksheet"). This will be very useful to me. -- Paul Cross try sub change_left_header() dim wks as worksheets for each wks in activeworkbook.worksheets with wks.pagesetup .leftheader = "your new header" end with next end sub -- Regards Frank Kabel Frankfurt, Germany |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
sorry, this was a typo on my side :-) -- Regards Frank Kabel Frankfurt, Germany "Paul Cross" schrieb im Newsbeitrag m... Thank you kindly. This appeared to work for me after dropping the 's' in the declaration line ("dim wks as worksheet"). This will be very useful to me. -- Paul Cross try sub change_left_header() dim wks as worksheets for each wks in activeworkbook.worksheets with wks.pagesetup .leftheader = "your new header" end with next end sub -- Regards Frank Kabel Frankfurt, Germany |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing header | Excel Discussion (Misc queries) | |||
Changing font in custom header that is based on cell value | Excel Discussion (Misc queries) | |||
Changing the color of header and footer text | Excel Discussion (Misc queries) | |||
Enter an Excel cell reference as part of a custom header/footer | Excel Worksheet Functions | |||
changing page numbers in repeated header | Excel Discussion (Misc queries) |