Bonjour,
Modifie ton code comme suivant :
Private Sub CommandButton1_Click()
Dim derlig As Long
If OptionButton1 = True Then
derlig = Sheets("Reliquats").Range("A" & Rows.Count).End(xlUp).Row
Worksheets("Reliquats").Range("B" & derlig + 1) = TextBox1
Worksheets("Reliquats").Range("C" & derlig + 1) = TextBox2
Worksheets("Reliquats").Range("A" & derlig + 1) = DTPicker1
MsgBox "Commande ajoutée", vbInformation, "Saisie"
ElseIf OptionButton2 = True Then
derlig = Sheets("Soldee").Range("A" & Rows.Count).End(xlUp).Row
Worksheets("Soldee").Range("B" & derlig + 1) = TextBox1
Worksheets("Soldee").Range("C" & derlig + 1) = TextBox2
Worksheets("Soldee").Range("A" & derlig + 1) = DTPicker1
MsgBox "Commande ajoutée", vbInformation, "Saisie"
ElseIf OptionButton3 = True Then
derlig = Sheets("Preparation").Range("A" & Rows.Count).End(xlUp).Row
Worksheets("Preparation").Range("B" & derlig + 1) = TextBox1
Worksheets("Preparation").Range("C" & derlig + 1) = TextBox2
Worksheets("Preparation").Range("A" & derlig + 1) = DTPicker1
MsgBox "Commande ajoutée", vbInformation, "Saisie"
Else
MsgBox "Commande non ajoutée", vbInformation, "Saisie"
End If
End Sub