Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Jul 2001
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Save date in Cell (Office97 - Excel 97)

    How do you place a 'Save Date' in a cell. Example would be, as in Word, you insert a field code that provides save date of the documument. <img src=/S/beep.gif border=0 alt=beep width=15 height=15>

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Save date in Cell (Office97 - Excel 97)

    To put the saved date into cell A1 of sheet1, add this macro into the thisworkbook object in VB. Change the cell reference and sheet name as appropriate. whenever you save the workbook the date will be updated. If you want the date and time use NOW instead of DATE in the macro.

    Steve

    <pre>Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Sheets("sheet1").Range("A1").Value = Date
    End Sub
    </pre>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •