PC Review


Reply
Thread Tools Rate Thread

Changing (Part of) Header Without Changing Footer or Rest of Header

 
 
Paul Cross
Guest
Posts: n/a
 
      19th May 2004
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
 
Reply With Quote
 
 
 
 
Frank Kabel
Guest
Posts: n/a
 
      19th May 2004
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

 
Reply With Quote
 
Paul Cross
Guest
Posts: n/a
 
      20th May 2004
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 With Quote
 
Frank Kabel
Guest
Posts: n/a
 
      20th May 2004
Hi
sorry, this was a typo on my side :-)

--
Regards
Frank Kabel
Frankfurt, Germany

"Paul Cross" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Header/Footer images 1/2 way =?Utf-8?B?VXNpbmcgSlBHcyBmb3IgYSBXb3JkIFRlbXBsYXRl Microsoft Word Document Management 1 27th Feb 2007 08:40 PM
Changing calendar header and or footer =?Utf-8?B?RGVuaXNh?= Microsoft Outlook Calendar 0 10th May 2006 03:03 PM
Header/footer part of a template for changing information =?Utf-8?B?S2F5?= Microsoft Word Document Management 2 11th Feb 2006 03:36 PM
Changing the header and footer in a query =?Utf-8?B?UGF0Qg==?= Microsoft Access 2 23rd Oct 2004 03:57 AM
Changing the default Header & Footer Craig Microsoft Excel Misc 1 12th Feb 2004 03:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:06 AM.