1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| 'Pour initialiser le formulaire FrmVoiture
Private Sub UserForm_Initialize()
Application.ScreenUpdating = False
With Worksheets("Source")
DerLig = .Cells(Rows.Count, 3).End(xlUp).Row 'donnée de la sortie
TextBox17.Value = Format(CDate(Now), "dd/mm/yyyy")
TextBox17 = Format(CDate(Date), "dd/mm/yyyy")
TextBox19 = Format(CDate(Date), "dd/mm/yyyy")
Me.TextBox16 = .Range("A" & DerLig) 'Date du début Route
DateDeb = CDbl(CDate(TextBox16.Value))
DateFin = CDbl(Date)
Me.TextBox13 = Format(DateFin - DateDeb, "m") - 1
Me.TextBox18 = .Range("D" & DerLig) 'Date du début Vtt
Me.TextBox14 = .Range("F" & DerLig) 'Difference Vtt
End With
Application.ScreenUpdating = True
End Sub |