I have two date. I want to count number of days between.
But the result is wrong, it's 539. When I opened the debugs I see that date_today is Variant/String Type.
Code:
Dim date_today, test_date As Date
Dim result as Long
date_today = Format(Now(), "dd/mm/yyyy")
test_date = Format(wsM.Range("M10").Value, "dd/mm/yyyy")
result= DateDiff("D", date_today, test_date)
But the result is wrong, it's 539. When I opened the debugs I see that date_today is Variant/String Type.