ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Header and Footer (https://www.excelbanter.com/excel-discussion-misc-queries/39875-header-footer.html)

Jav

Header and Footer
 
Can the Header and Footer be automatic set everytime I create a spreadshheet ?

Ankur

by using the macro you can set the header and footer ...also the print out
format and whenever u work on new sheet u have to just run the macro.
Tools \ Macros

"Jav" wrote:

Can the Header and Footer be automatic set everytime I create a spreadshheet ?


Bob Phillips

You can also set it at print time

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftHeader = "Date: " & Format(Date, "dd mmm yyyy")
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ankur" wrote in message
...
by using the macro you can set the header and footer ...also the print out
format and whenever u work on new sheet u have to just run the macro.
Tools \ Macros

"Jav" wrote:

Can the Header and Footer be automatic set everytime I create a

spreadshheet ?




All times are GMT +1. The time now is 05:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com