Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
holiday dates bucci Excel Worksheet Functions 4 June 15th 06 09:35 AM
How to calculate number of month from 2008 in Excel? Frank Excel Discussion (Misc queries) 7 February 7th 06 02:29 PM
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
Difference in number of Excel NewsGroups Hari Prasadh Excel Discussion (Misc queries) 1 January 25th 05 11:32 AM
how to get week number in month in excel ? ikin Charts and Charting in Excel 2 January 16th 05 05:54 PM


All times are GMT +1. The time now is 07:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"