Date in Header

eggtimer

Board Regular
Joined
Apr 16, 2003
Messages
125
Hi

Is it possible to create a setting somewhere that on every new spreadsheet I create, the date automatically appears in the top right header window when printing? (Getting a little bit of grief for not dating reports)

On most of my continuing reports I have a "=today()" somewhere.

But the problem I am getting is where I just pull some data, drop it on a sheet and run a quick pivot table. I always title it, rarely date it.

I am thinking of putting it in the Header, because I don't print a lot of my spreadsheets, and cannot think of a consistently spare cell in all sheets.

Or is there some sort of OnPrint type event I can have run each time, I print, I have a workbook that opens from XLstart is it possible to put anything in there?


Thanks


Wayne
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Or right click the Excel logo just to the left of File on the menu bar, select View Code and paste in

Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.CenterHeader = "&D"
End Sub
 
Upvote 0
Cheers

I like that sound of that as well

I have 2007, so don't have "File" anymore, do you know where to put it in 2007?


Wayne
 
Upvote 0
In Excel 2007 press ALT + F11 to open the Visual Basic Editor, in the left hand pane under 'Project - VBAProject' Right click ThisWorkbook and select View Code.
 
Upvote 0
Hi, i tried that, could only find "This Workbook" under the actual workbook I was in.

Should there be a "This workbook" that controls all future workbooks i create?

Wayne
 
Upvote 0
Sorry, my code will only work in the current workbook. If you want something that applies to all workbooks then Andrew's suggestion of a template is a much better idea.
 
Upvote 0
Cool, no worries

Thought i was missing something there

Maybe a good idea for the future.

I haven't looked into it, but i preferred your idea, because i have the "New Document" item on Quick Access toolbar.

I am hoping that I can set the template as the default and it will be triggered by this icon, or if not I can associate another icon with this template.

If that is the case, no need to reply, I'm just being lazy.

Thanks guy's


Wayne
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top