+ Reply to Thread
Results 1 to 7 of 7

Date Macro

Hybrid View

Mikeyb7 Date Macro 11-26-2007, 11:56 AM
Mikeyb7 Can any1 please help with... 11-26-2007, 12:21 PM
bhofsetz What about the spreadsheet do... 11-26-2007, 02:54 PM
Mikeyb7 Almost there! 11-27-2007, 07:52 AM
EdMac If the macro was to run on... 11-27-2007, 08:24 AM
Mikeyb7 is it possible to have tell... 11-27-2007, 08:40 AM
EdMac I'm no VB wizard but have you... 11-27-2007, 10:08 AM
  1. #1
    Registered User
    Join Date
    11-23-2007
    Posts
    12

    Almost there!

    Hi

    I have the macro set up so it should show when a spreadsheet was last modified by using the following;

    Sub DateLastModified()
    Dim fs, f
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFile("T:\Jobs\Job Loading\Manual Job Loading\Job Board Brands\CareerStructure.com\Weekly Task Spreadsheet.xls")
    Cells(2, 1) = f.DateLastModified
    End Sub


    and i have the auto run feature of;

    Private Sub Workbook_Open()
    Run "DateLastModified"
    End Sub


    However, when the spreadsheet is opened it gives me the date of when i'm opening the document and not when it was last saved by someone else who has just used it?

    Can any1 please help!

    Thanks

    Mike

  2. #2
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    If the macro was to run on workbook close, that would tell you when it was last closed.

    Ed

  3. #3
    Registered User
    Join Date
    11-23-2007
    Posts
    12
    is it possible to have tell me when it was last saved or edited by someone else and not the time when i open the spreadsheet?

    Thanks

    Mike

  4. #4
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    I'm no VB wizard but have you tried this?

    Private Sub Workbook_close()
    Run "DateLastModified"
    End Sub
    When the book is closed the code runs and enters the date. When you open it, you can see when it was last closed. If you added a bit more code you could also have the user name of the last who closed it.

    Ed

+ 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