Dim NL As Long
Private Sub ComboBox2_Change()
NbOnglet = Sheets.Count
For i = 1 To 10
Controls("Textbox" & i) = ""
Next i
With Sheets("FORMATION2")
For Each cell In .Range("B4:H" & .Range("B65536").End(xlUp).Row)
If ComboBox2.Value = cell.Value Then
For j = 1 To 6
Controls("Textbox" & j) = cell.Offset(0, j + 0).Value
ClePrimaire = cell.Offset(0, -1).Value
Next j
End If
Next
End With
With Sheets("FORMATION3")
For Each cell In .Range("B4:H" & .Range("B65536").End(xlUp).Row)
If ClePrimaire = cell.Value Then
For j = 7 To 10
Controls("Textbox" & j) = cell.Offset(6, j - 1).Value
Next j
End If
Next
End With
End Sub
Private Sub UserForm_Initialize()
Dim cell As Range
With Sheets("FORMATION2")
For Each cell In .Range("B5:B" & .Range("B65536").End(xlUp).Row)
ComboBox2.AddItem (cell)
Next
End With