+ Reply to Thread
Results 1 to 2 of 2

how to substract 2 dates in vba

Hybrid View

vahe.holtian how to substract 2 dates in... 11-13-2012, 06:51 AM
JapanDave Re: how to substract 2 dates... 11-13-2012, 07:01 AM
  1. #1
    Registered User
    Join Date
    11-10-2012
    Location
    Beirut, Lebanon
    MS-Off Ver
    Excel 2007
    Posts
    3

    how to substract 2 dates in vba

    hey

    i want to check if the file was modified in the last 20 seconds.


    i have this now:


    Dim fileModDate As String

    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFile(<filenamestringhere>)

    fileModDate = f.DateLastModified


    what should i do next? thanks

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: how to substract 2 dates in vba

    Hi, this will subtract 20 seconds from the time now.
    Dim tNow As Date
    
        tNow = DateAdd("s", -20, d)
    As for your problem, in what way will the file be modified?
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

+ 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