Code: Select all
dim D1 As Date, D2 As Date
Dim VAR_SPLIT() As String, y as long
'NOME_FILE="AAAA-20100531-20100604"
VAR_SPLIT = Split(NOME_FILE, "-")
D1 = Format(CDate(VAR_SPLIT(1)), "DD/MM/YYYY")
D2 = Format(CDate(VAR_SPLIT(2)), "DD/MM/YYYY")
Y = DateDiff("d", D1, D2)
I need to have in days the difference from D1 and D2