Dim F As Worksheet
Dim c, Mondico
Dim Ligne1, Ligne2 As Range
Private Sub CommandButton4_Click()
Unload Me
End Sub
Private Sub SN_Click()
Dim cel As Range
DT.Clear
For Each cel In Ligne1
If cel Is Nothing Then Exit Sub
If cel = Ligne1.Find(SN) Then
DT.AddItem cel.Offset(0, 1)
End If
Next cel
End Sub
Private Sub UserForm_Initialize()
Set F = Worksheets("UUT")
Set Ligne1 = F.Range("b3", F.Range("b65536").End(xlUp))
Set Ligne2 = F.Range("c3", F.Range("c65536").End(xlUp))
Set Mondico = CreateObject("Scripting.Dictionary")
For Each c In Range(F.[A3], F.[A800].End(xlUp))
If c.Value <> "" Then Mondico.Item(c.Value) = c.Value
Next c
Me.PN.List = Mondico.items
End Sub
Private Sub DT_Change()
Dim Index&
With DT
If .ListIndex = -1 Then: Exit Sub
Index = .ListIndex + 1
End With
With Ligne2.Cells(Index)
NNO = .Offset(0, 2)
'Ect
End With
End Sub
Private Sub PN_Change()
If Me.PN <> "" Then
Me.SN.Clear
Me.DT.Clear
'Me.TextBox1 = ""
Set Mondico = CreateObject("Scripting.Dictionary")
For Each c In Range(F.[A3], F.[A800].End(xlUp))
If c = Me.PN And c.Offset(, 1).Value <> "" Then
Mondico.Item(c.Offset(, 1).Value) = c.Offset(, 1).Value
End If
Next c
Me.SN.List = Mondico.items
End If
End Sub