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
 

Some videos you may like

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
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
 

eggtimer

Board Regular
Joined
Apr 16, 2003
Messages
125

ADVERTISEMENT

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
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
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.
 

eggtimer

Board Regular
Joined
Apr 16, 2003
Messages
125

ADVERTISEMENT

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
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
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.
 

eggtimer

Board Regular
Joined
Apr 16, 2003
Messages
125
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,910
Messages
5,598,803
Members
414,260
Latest member
joishe

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
Top