Public Function VariationTime(ID As String, timevar As Date) As Double
Dim nbligne As Integer, i As Integer, l As Integer, col As Integer
Dim Timeloop As Date
Dim tableau As Variant
Dim c As Range
Dim First As Double, Last As Double, diff As Double
Set c = Sheets("DATA").Rows(1).Find(ID, LookIn:=xlValues, LookAt:=xlWhole)
col = c.Column
Timeloop = "00:05:00"
nbligne = timevar / Timeloop
i = 3
tableau = Sheets("DATA").Range(Cells(i, col), Cells(i + nbligne - 1, col))
First = tableau(1, 1)
Last = tableau(nbligne, 1)
VariationTime = First - Last
End Function