Evagrius Ponticus
Well-known Member
- Joined
- May 24, 2007
- Messages
- 1,467
Hi,
I am not sure if DateDiff can do this. The code below give me 7. But I want the answer to include only full months - not partial months. I know that can be done in Excel using the Datedif, but not sure if it is possible using the VB Datediff.
So I would like 6 to be the answer below because there are only 6 full month between the two dates.
cells(MyRow, "s") = 8/31/2013
cells(15,Mycol) = 3/2/2014
I am not sure if DateDiff can do this. The code below give me 7. But I want the answer to include only full months - not partial months. I know that can be done in Excel using the Datedif, but not sure if it is possible using the VB Datediff.
So I would like 6 to be the answer below because there are only 6 full month between the two dates.
cells(MyRow, "s") = 8/31/2013
cells(15,Mycol) = 3/2/2014
Code:
Cells(MyRow, MyCol).Value = DateDiff("d", Cells(MyRow, "S"), Cells(15, MyCol))