Private Sub CommandButton1_Click()
Nom = "Déplacement"
Sheets("feuil2").Cells(Rows.Count, 2).End(xlUp)(2) = MonthView1.Value
Sheets("feuil2").Cells(Rows.Count, 3).End(xlUp)(2) = TextBox1.Value
lastline = Sheets(2).Range("A65536").End(xlUp).Row
If lastline = 1 Then
Sheets(2).Cells(lastline + 1, 1) = "Déplacement 1"
Exit Sub
End If
If Sheets(2).Cells(lastline, 1) <> "" Then
num = Mid(Sheets(2).Cells(lastline, 1), 13, Len(Sheets(2).Cells(lastline, 1)))
Sheets(2).Cells(lastline + 1, 1) = "Déplacement " & num + 1
End If
MsgBox "Données enregistrées: " & MonthView1.Value & " " & TextBox1.Value, , "Validation"
Unload UserForm1
ActiveWorkbook.Save
Sheets("Feuil2").Activate
End Sub
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
End Sub