Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 : Quote:
converted in VBA function? Thx! JJD -- Message posted via http://www.officekb.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"does not work" does not give much information.
But in VBA, it is DATEDIFF (2 F's) Niek Otten "Jean-Jerome Doucet via OfficeKB.com" wrote in message ... 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 : Quote:
But it does not work. Maye it is that dateDif Excel function cannot be converted in VBA function? Thx! JJD -- Message posted via http://www.officekb.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So that is without "Application."
"Niek Otten" wrote in message ... "does not work" does not give much information. But in VBA, it is DATEDIFF (2 F's) Niek Otten "Jean-Jerome Doucet via OfficeKB.com" wrote in message ... 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 : Quote:
But it does not work. Maye it is that dateDif Excel function cannot be converted in VBA function? Thx! JJD -- Message posted via http://www.officekb.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are right, my apologies for the lack of details.
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). Here's the way it is supposed to work : Oh and it is J16 - I16 (upper date - lower date). Werner -- Message posted via http://www.officekb.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ops wrong name (I use Werner as a nickname on other forums but I use my real
name on this one.) Jean-Jérôme Doucet -- Message posted via http://www.officekb.com |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It is also a different order
With Worksheets("Formulaire") Baux = DateDiff("m", .Range("I16").Value, .Range("J16").Value) / 12 End With -- HTH RP (remove nothere from the email address if mailing direct) "Jean-Jerome Doucet via OfficeKB.com" wrote in message ... 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 : Quote:
But it does not work. Maye it is that dateDif Excel function cannot be converted in VBA function? Thx! JJD -- Message posted via http://www.officekb.com |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you a lot Bob!!
I adjusted a bit the code for my needs and i works perfectly! Have a good day! Werner Quote:
Message posted via http://www.officekb.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subtracting Dates | Excel Discussion (Misc queries) | |||
Subtracting Dates | Excel Discussion (Misc queries) | |||
Subtracting Dates | Excel Discussion (Misc queries) | |||
Subtracting dates | Excel Discussion (Misc queries) | |||
Subtracting Dates | Excel Discussion (Misc queries) |