Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Is there a way to change the format of the date button in the header? I get
12/11/04 and would like December 11, 2004. Thanks, Jim |
#2
![]() |
|||
|
|||
![]()
I bet you're writing about File|page setup|Header/footer tab and clicking that
date button to insert the current date (you get this: &[Date] in the header section. If yes, you could type anything you want (a static date, though). Or you could use a macro that sets the header whenever you print/print preview. I recorded a macro when I changed the header. I got this code (after deleting lots of stuff I didn't care about): With ActiveSheet.PageSetup .RightHeader = "&D" End With I could change it to: With ActiveSheet.PageSetup .RightHeader = format(date,"mmmm dd, yyyy") End With But if you live with what I did, you may lose stuff that you want. So record your macro and modify it according to what you really want (along with the date stuff). But now you have to put that code in a special spot. Inside the VBE (where that recorded macro is) hit ctrl-r (to see the project explorer) find your project and expand it using the +'s in front of each object. (Just like Windows explorer and folders.) When you see ThisWorkbook, double click on it and paste your code there. But you'll have to modify it slightly. I used this: Option Explicit Private Sub Workbook_BeforePrint(Cancel As Boolean) With Me.Worksheets("sheet1") .RightHeader = Format(Date, "mmmm dd, yyyy") End With End Sub I only want the right header of worksheets Sheet1 to get that head--and I don't want anything else to change. If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm Jim wrote: Is there a way to change the format of the date button in the header? I get 12/11/04 and would like December 11, 2004. Thanks, Jim -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I Break links Using Excel 2000 | Excel Discussion (Misc queries) | |||
Excel 2003 "File Open": how keep folders at top with sort by Date. | Excel Discussion (Misc queries) | |||
pivotcell object to excel 2000 | Excel Discussion (Misc queries) | |||
How do I setup a spin button in excel | Excel Discussion (Misc queries) | |||
Creating a Date Selector in Excel VBA? | Excel Discussion (Misc queries) |