Last Modified Date in Header

  • Thread starter Thread starter Deb
  • Start date Start date
D

Deb

I have a spreadsheet where I want the date displayed in
the header to be the date the speadsheet was last
modified, not the current date.

Current I change this date manually each time I edit the
spreadsheet, but is there some way have it done
automatically?

Thanks.

Deb
 
I have a spreadsheet where I want the date displayed in
the header to be the date the speadsheet was last
modified, not the current date.

Current I change this date manually each time I edit the
spreadsheet, but is there some way have it done
automatically?

Yes. Write a VB macro called Auto_Open that puts the date in the proper
cell. It will automatically run when the spreadsheet is loaded.
 
I have the date in the header not in a cell.
ALso, how do I program it so the date only changes when
the spreadsheet is modified?

Thanks.
 
Deb,

You can do it with VBA code. Paste the following code in the
'ThisWorkbook' module:

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

ActiveSheet.PageSetup.LeftHeader = "&""Arial""Updated on " & Date

End Sub


In case of word-wrap, each line is double-spaced above. Anything that
appears to be two lines is actually one. This will update the date in
the header only when you save the file. I think this is what you want
to do.

If you have more than one sheet, change ActiveSheet.PageSetup. to
Sheet1.PageSetup. and copy/modify the line for Sheet2, Sheet3, etc.

If you need help entering VBA code into your sheet, reply to this post
and we will help you.

-Mike



I have the date in the header not in a cell.
ALso, how do I program it so the date only changes when
the spreadsheet is modified?

Thanks.

Mike Argy
Custom Office Solutions
and Windows/UNIX applications

Please post on-topic responses to the newsgroup

To e-mail me, remove nospam from the address in the headers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top