+ Reply to Thread
Results 1 to 7 of 7

Date last modified cell

  1. #1
    Leon
    Guest

    Date last modified cell

    Hi guys,

    I am wondering if there is a function or vba script in excel that can
    show the date my .xls fle was last modified?

    So i need it to only change when any cells are changed with in the
    workbook but if the workbook is opened and just viewed at, the date
    will not change.

    Thanks for the help.


  2. #2
    Registered User
    Join Date
    02-11-2005
    Posts
    85
    from Excel Help

    DateLastModified Property


    Description

    Returns the date and time that the specified file or folder was last modified. Read-only.

    Syntax

    object.DateLastModified

    The object is always a File or Folder object.

    Remarks

    The following code illustrates the use of the DateLastModified property with a file:

    Sub ShowFileAccessInfo(filespec)
    Dim fs, f, s
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFile(filespec)
    s = UCase(filespec) & vbCrLf
    s = s & "Created: " & f.DateCreated & vbCrLf
    s = s & "Last Accessed: " & f.DateLastAccessed & vbCrLf
    s = s & "Last Modified: " & f.DateLastModified
    MsgBox s, 0, "File Access Info"
    End Sub

  3. #3
    Norman Jones
    Guest

    Re: Date last modified cell

    Hi Leon,

    You also have a reponse at your post in Programming.


    ---
    Regards,
    Norman


    "Leon" <[email protected]> wrote in message
    news:[email protected]...
    > Hi guys,
    >
    > I am wondering if there is a function or vba script in excel that can
    > show the date my .xls fle was last modified?
    >
    > So i need it to only change when any cells are changed with in the
    > workbook but if the workbook is opened and just viewed at, the date
    > will not change.
    >
    > Thanks for the help.
    >




  4. #4
    Héctor Miguel
    Guest

    Re: Date last modified cell

    hi !

    just to remark that (filespec) *must be* a closed file
    if OP's .xls is an opened workbook... see: http://tinyurl.com/8zuwd
    also, if OP needs to track changes in wb' cells *only* from the last *real* save...
    try the excel4 macro-funciton: Get.Document(4)

    hth,
    hector.

    > goober wrote in message...
    > from Excel Help
    > DateLastModified Property
    > Description
    > Returns the date and time that the specified file or folder was last modified. Read-only.
    > Syntax
    > object.DateLastModified
    > The object is always a File or Folder object.
    > Remarks
    > The following code illustrates the use of the DateLastModified property with a file:
    > Sub ShowFileAccessInfo(filespec)
    > Dim fs, f, s
    > Set fs = CreateObject("Scripting.FileSystemObject")
    > Set f = fs.GetFile(filespec)
    > s = UCase(filespec) & vbCrLf
    > s = s & "Created: " & f.DateCreated & vbCrLf
    > s = s & "Last Accessed: " & f.DateLastAccessed & vbCrLf
    > s = s & "Last Modified: " & f.DateLastModified
    > MsgBox s, 0, "File Access Info"
    > End Sub




  5. #5
    Bob Phillips
    Guest

    Re: Date last modified cell

    And another in worksheet.functions

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Norman Jones" <[email protected]> wrote in message
    news:u%[email protected]...
    > Hi Leon,
    >
    > You also have a reponse at your post in Programming.
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    > "Leon" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi guys,
    > >
    > > I am wondering if there is a function or vba script in excel that can
    > > show the date my .xls fle was last modified?
    > >
    > > So i need it to only change when any cells are changed with in the
    > > workbook but if the workbook is opened and just viewed at, the date
    > > will not change.
    > >
    > > Thanks for the help.
    > >

    >
    >




  6. #6
    Bob Phillips
    Guest

    Re: Date last modified cell

    So Norman, are you suggesting circular references :-))


    "Norman Jones" <[email protected]> wrote in message
    news:u%[email protected]...
    > Hi Leon,
    >
    > You also have a reponse at your post in Programming.
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    > "Leon" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi guys,
    > >
    > > I am wondering if there is a function or vba script in excel that can
    > > show the date my .xls fle was last modified?
    > >
    > > So i need it to only change when any cells are changed with in the
    > > workbook but if the workbook is opened and just viewed at, the date
    > > will not change.
    > >
    > > Thanks for the help.
    > >

    >
    >




  7. #7
    Norman Jones
    Guest

    Re: Date last modified cell

    Hi Bob,

    LOL.

    At least I avoided triangularity - I ignored the Worksheet functions post!

    ---
    Regards,
    Norman


    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    > So Norman, are you suggesting circular references :-))
    >
    >
    > "Norman Jones" <[email protected]> wrote in message
    > news:u%[email protected]...
    >> Hi Leon,
    >>
    >> You also have a reponse at your post in Programming.
    >>
    >>
    >> ---
    >> Regards,
    >> Norman




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1