Sub Initialisation()
With Sheets("PLAN PROD")
DL = .Range("A65500").End(xlUp).Row
UserForm1.ComboBox1.List = .Range("A5:A" & DL - 2).Value
UserForm1.ComboBox1.ListIndex = 0
UserForm1.Show
End With
End Sub
et
Private Sub ComboBox1_Change()
With Sheets("PLAN PROD")
Ligne = Application.Match(ComboBox1.Value, .[A:A], 0)
UserForm1.TextBox1 = .Cells(Ligne, "Y")
End With
End Sub
Private Sub CommandButton1_Click()
Private Sub CommandButton1_Click()
With Sheets("PLAN PROD")
Ligne = Application.Match(ComboBox1.Value, .[A:A], 0)
If IsNumeric(UserForm1.TextBox1) = True Then
.Cells(Ligne, "Y") = Val(UserForm1.TextBox1)
MsgBox ComboBox1.Value & " modifiée."
End If
UserForm1.TextBox1 = ""
End With
End Sub