Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Changing (Part of) Header Without Changing Footer or Rest of Header

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Changing (Part of) Header Without Changing Footer or Rest of Header

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Changing (Part of) Header Without Changing Footer or Rest of Header

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Changing (Part of) Header Without Changing Footer or Rest of Header

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing header Melissa MSRS R.T.(R) Excel Discussion (Misc queries) 4 November 23rd 09 07:50 PM
Changing font in custom header that is based on cell value michaelberrier Excel Discussion (Misc queries) 1 December 29th 06 05:10 AM
Changing the color of header and footer text Singhu Excel Discussion (Misc queries) 5 October 5th 06 01:08 AM
Enter an Excel cell reference as part of a custom header/footer Suegi123 Excel Worksheet Functions 1 April 1st 05 10:55 PM
changing page numbers in repeated header Jennifer Excel Discussion (Misc queries) 0 March 2nd 05 05:09 PM


All times are GMT +1. The time now is 08:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"