Option Explicit
Private WithEvents CL As ComboBoxLiées, TVL(), LCou As Long
Private Sub UserForm_Initialize()
Set CL = CBxL.Création.ComboBoxLiées
CL.Plage Feuil3
CL.Add Me.box1, 1
CL.Add Me.boxé, 2
CL.Add Me.box3, 3, "&"
CL.CouleurSympa
CL.Actualiser
End Sub
Private Sub CL_Change(ByVal Complet As Boolean, ByVal NbrLgn As Long)
LCou = 0
End Sub
Private Sub CL_Résultat(Lignes() As Long)
LCou = Lignes(1)
End Sub
Private Sub valider_Click()
If LCou = 0 Then
ReDim TVL(1 To 1, 1 To CL.Colonnes.Count)
CL.ValeursVers TVL
CL.Lignes.Add.Range.Value = TVL
CL.Lignes.Parent.Sort.Apply
CL.Actualiser
End If
CL.Nettoyer
End Sub