Dim x As Long
Private Sub UserForm_Initialize()
x = Right(Cells(Rows.Count, 1).End(3), 3)
If Left(Cells(Rows.Count, 1).End(3), 3) = "C15" Then
TextBoxAutreS1 = ("C16/000")
Else
TextBoxAutreS1 = ("C16/" & Format(x + 1, "000"))
End If
End Sub
Private Sub CBvalidS_Click()
Cells(Rows.Count, 1).End(3)(2) = TextBoxAutreS1
UserForm_Initialize
End Sub