![]() |
How can I add present month, as number, to an header in excel?
Have a work book with many sheets and want to have as part of a header:
"Sheet Name" - "Present Month" - "Present Year" that will update automatically header would look like "name-12-06" was hoping I could do &[Tab] - &[Month] - &[Year] the &[Tab] is ok, any thoughts on the rest. Agnes |
How can I add present month, as number, to an header in excel?
Agnes
Could you live with a macro? Sub Sheet_Date_Header() ActiveSheet.PageSetup.RightHeader = ActiveSheet.Name & _ "-" & Format(Now, "mm") & _ "-" & Format(Now, "yy") End Sub If you want completely automatic you could use in a BeforePrint macro. Private Sub Workbook_BeforePrint(Cancel As Boolean) ActiveSheet.PageSetup.RightHeader = ActiveSheet.Name & _ "-" & Format(Now, "mm") & _ "-" & Format(Now, "yy") End Sub Gord Dibben MS Excel MVP On Thu, 21 Dec 2006 10:01:02 -0800, Agnes _TASOT <Agnes wrote: Have a work book with many sheets and want to have as part of a header: "Sheet Name" - "Present Month" - "Present Year" that will update automatically header would look like "name-12-06" was hoping I could do &[Tab] - &[Month] - &[Year] the &[Tab] is ok, any thoughts on the rest. Agnes |
All times are GMT +1. The time now is 03:21 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com