Private Sub UserForm_Initialize()
With Sheets("parametre")
Me.Client.List = Range(.[A2], .[b65000].End(xlUp)).Value
End With
End Sub
Private Sub Client_Change()
codeclient = Me.Client.Column(1)
temp = Evaluate("=MAX(IF(LEFT(Lot,3)=" & Chr(34) & codeclient & Chr(34) & ",VALUE(RIGHT(Lot,2))))") + 1
Me.Nlot = codeclient & Format(temp, "00")
End Sub
Private Sub CommandButton1_Click()
With Sheets("bd")
ligne = .[A65000].End(xlUp).Row + 1
.Cells(ligne, 2) = Me.Client
.Cells(ligne, 1) = Me.Nlot
.Cells(ligne, 3) = Me.NBC
.Cells(ligne, 4) = Me.QCde
.Cells(ligne, 5) = Me.DL
End With
End Sub