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

  • Thread starter Thread starter Paul Cross
  • Start date Start date
P

Paul Cross

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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top