Permanent Custom Header/Footer

  • Thread starter Thread starter Amr Tabbarah
  • Start date Start date
A

Amr Tabbarah

If a sheet has a Custom Header/Footer and a standard Custo
Header/Footer is selected once, the Custom Header/Footer disappear.

Is there a way to keep/save the Custom Header/Footer and switch t
standard Header/Footer without loosing the Custom ones?

Any suggestion would be appreciated.


Thanks
 
Sure, have your Custom Header/Footer Settings set in a Named Macro;
If you switch to the Standard and then need to go back to Custom, just run
the Macro.
 
Thank you JMay.

Could you please also inform about the specific macro functions that
would call the Header or Footer, select Left, Middle or Right side, and
I will try to take it up from there to write the Macro.

Thanks.



Amr
 
You'll probably want to add your final code that you come up with to your
personal.xls workbook as a standard module and create a button on your
toolbar to activate; that is. when you want to restore the custom
header/footer settings:

a quick sample:
Sub CellInHeader()
ActiveSheet.PageSetup.LeftHeader = Range("A1")
End Sub


HTH
 
Hi Amr,

See examples in
Pathname in headings, footers, and cells
http://www.mvps.org/dmcritchie/excel/pathname.htm

Sub PutFileNameInFooter()
'Documented in http://www.mvps.org/dmcritchie/excel/pathname.htm
'alternative -- lowercase for pathname Sheetname as is within square brackets
'also using an 8 point font, lettercase of Sheetname is unchanged in this
'example because you have control and can change it within the workbookbook
'Use of WITH provide a prefix for names that begin with a period
With ActiveSheet.PageSetup
.LeftFooter = "&8" & _
LCase(ActiveWorkbook.FullName) & " &A "
If .RightFooter = "" Then .RightFooter = "Page &P of &N"
End With
End Sub

note the period in front of .RightFooter, because of the With it is equivalent to
ActiveSheet.PageSetup.RightFooter

See Help (in VBE) --> Index --> Find --> Formatting Codes for Headers and Footers

You may use LeftFooter, CenterFooter, RightFooter, LeftHeader, CenterHeader,
or RightHeader where LeftFooter has been used above.

You can post directly to the Microsoft newsgroups without having to
download HTML webpages, which generally contain advertising.
..
 

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