+ Reply to Thread
Results 1 to 2 of 2

Subtracting Dates VBA

  1. #1
    Registered User
    Join Date
    06-14-2005
    Posts
    41

    Question Subtracting Dates VBA

    Hi,

    I want to subtract two dates 'YYYYY-MM-DD' but by doing in VBA and pointing to their respective cells and dump the result in another cell.

    For example, I am working on this experiment :

    Sub datescalcul()
    Dim Baux As Double
    Baux = Application.DATEDIF(Worksheets("Formulaire").Range("I16").Value, Worksheets("Formulaire").Range("J16").Value, "m") / 12
    sheets("Formulaire").Range("K16").Value = Baux
    End Sub
    But it does not work. Maye it is that dateDif Excel function cannot be converted in VBA function?
    Thx!

    Werner

  2. #2
    Registered User
    Join Date
    06-14-2005
    Posts
    41
    I forgot to mention that the error is on my subtraction. It says property or method not managed by this object. And I want to return a numer of years and have decimal or where we are in the last years (e.g. 3 and a half year 3,50).

    Werner

+ 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