Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How to put save date in the header (or footer)

I would like to enter a date in the header (or footer) of my Excel
spreadsheet. However, I want it to be the date the file was last saved, not
today's date. Is there a way to do this?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How to put save date in the header (or footer)

Sub Last_Saved_Footer()
'Private Sub Workbook_BeforePrint(Cancel As Boolean) 'alternate method
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = "&8Last Saved : " & _
Format(ThisWorkbook.BuiltinDocumentProperties("Las t Save Time"), _
"yyyy-mmm-dd hh:mm:ss")
Next wkSht
End Sub


Gord Dibben MS Excel MVP

On Tue, 22 Jul 2008 12:46:10 -0700, GypsyHarper
wrote:

I would like to enter a date in the header (or footer) of my Excel
spreadsheet. However, I want it to be the date the file was last saved, not
today's date. Is there a way to do this?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default How to put save date in the header (or footer)

Hi GypsyHarper

See
http://www.rondebruin.nl/print.htm#Last


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"GypsyHarper" wrote in message ...
I would like to enter a date in the header (or footer) of my Excel
spreadsheet. However, I want it to be the date the file was last saved, not
today's date. Is there a way to do this?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How to put save date in the header (or footer)

The code worked splendidly in my test file. But when I went to put it in the
file I actually want to use it in, the "ThisWorkbook" icon does not appear,
even after I saved a copy as a Macro Enabled file (I'm using Excel 2007, by
the by). Any ideas?

"Ron de Bruin" wrote:

Hi GypsyHarper

See
http://www.rondebruin.nl/print.htm#Last


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"GypsyHarper" wrote in message ...
I would like to enter a date in the header (or footer) of my Excel
spreadsheet. However, I want it to be the date the file was last saved, not
today's date. Is there a way to do this?


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default How to put save date in the header (or footer)

the "ThisWorkbook" icon does not appear,

???

If you not see it see this page
http://www.rondebruin.nl/code.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"GypsyHarper" wrote in message ...
The code worked splendidly in my test file. But when I went to put it in the
file I actually want to use it in, the "ThisWorkbook" icon does not appear,
even after I saved a copy as a Macro Enabled file (I'm using Excel 2007, by
the by). Any ideas?

"Ron de Bruin" wrote:

Hi GypsyHarper

See
http://www.rondebruin.nl/print.htm#Last


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"GypsyHarper" wrote in message ...
I would like to enter a date in the header (or footer) of my Excel
spreadsheet. However, I want it to be the date the file was last saved, not
today's date. Is there a way to do this?





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How to put save date in the header (or footer)

Yes, I see the project explorer. The project has no folders underneath it -
it's not just collapsed. There's no plus sign, and when I double click on
the project is says it's locked.

"Ron de Bruin" wrote:

the "ThisWorkbook" icon does not appear,


???

If you not see it see this page
http://www.rondebruin.nl/code.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"GypsyHarper" wrote in message ...
The code worked splendidly in my test file. But when I went to put it in the
file I actually want to use it in, the "ThisWorkbook" icon does not appear,
even after I saved a copy as a Macro Enabled file (I'm using Excel 2007, by
the by). Any ideas?

"Ron de Bruin" wrote:

Hi GypsyHarper

See
http://www.rondebruin.nl/print.htm#Last


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"GypsyHarper" wrote in message ...
I would like to enter a date in the header (or footer) of my Excel
spreadsheet. However, I want it to be the date the file was last saved, not
today's date. Is there a way to do this?



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default How to put save date in the header (or footer)

I think your VBA project is password protected

Does it ask you for a password ?



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"GypsyHarper" wrote in message ...
Yes, I see the project explorer. The project has no folders underneath it -
it's not just collapsed. There's no plus sign, and when I double click on
the project is says it's locked.

"Ron de Bruin" wrote:

the "ThisWorkbook" icon does not appear,


???

If you not see it see this page
http://www.rondebruin.nl/code.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"GypsyHarper" wrote in message ...
The code worked splendidly in my test file. But when I went to put it in the
file I actually want to use it in, the "ThisWorkbook" icon does not appear,
even after I saved a copy as a Macro Enabled file (I'm using Excel 2007, by
the by). Any ideas?

"Ron de Bruin" wrote:

Hi GypsyHarper

See
http://www.rondebruin.nl/print.htm#Last


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"GypsyHarper" wrote in message
...
I would like to enter a date in the header (or footer) of my Excel
spreadsheet. However, I want it to be the date the file was last saved, not
today's date. Is there a way to do this?




  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default How to put save date in the header (or footer)

Press <Alt + F11 to open the Visual Basic Editor.

In the upper left, double click the ThisWorkbookIcon to open the workbook
module.

In the code window on the right, drop down the left combo-box at the top and
change selection to WORKBOOK, and then drop down the right combo-box at the
top and change the selection to BEFORESAVE. Enter the code that appears
betwen the Private Sub Line and the End Sub Line.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

Dim ws As Worksheet

For Each ws In ThisWorkbook.Worksheets
With ws.PageSetup
.LeftFooter = "Last Save Time: &T"
.RightFooter = "Last Save Date: &D"
End With
Next ws

Set ws = Nothing

End Sub

Everytime you save the workbook the save time is posted to the left foooter
of each worksheet and the save date to the right footer of each worksheet.

Save the file to test drive it and then do a print preview.
--
Kevin Backmann


"GypsyHarper" wrote:

I would like to enter a date in the header (or footer) of my Excel
spreadsheet. However, I want it to be the date the file was last saved, not
today's date. Is there a way to do this?

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
Is it possible to save a custom header or footer? bduser Excel Discussion (Misc queries) 1 June 17th 07 11:30 PM
How to save a custom made header&footer HeintjeHB Excel Discussion (Misc queries) 3 June 29th 06 04:25 PM
Save a header or Footer Steve B Excel Discussion (Misc queries) 0 November 21st 05 06:40 PM
Date formula for footer/header Kurtlee Excel Discussion (Misc queries) 1 November 4th 05 05:01 PM
How to save a custom header/footer on ea. sheet of a workbook? auditthis Excel Worksheet Functions 0 August 12th 05 04:49 PM


All times are GMT +1. The time now is 03:56 PM.

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

About Us

"It's about Microsoft Excel"