Option Explicit
Private WithEvents CL As ComboBoxLiées, CA As ControlsAssociés, TLgn() As Long, LCou&, TVL()
Private Sub UserForm_Initialize()
Set CL = Création.ComboBoxLiées: CL.Plage Feuil3
Set CA = Création.ControlsAssociés: Set CA.Colonnes = CL.Colonnes
CL.Add ComboBox3, "Exo Audit"
CL.Add ComboBox1, "Red3"
CA.Add TextBox1, "? etc."
…
CL.LMaxDropBtn = 25
CL.CouleurSympa
CL.Actualiser
End Sub
Private Sub CL_Change(ByVal Complet As Boolean, ByVal NbrLgn As Long)
LCou = 0
If NbrLgn = 0 Then ListBox1.ListIndex = -1: ListBox1.Clear
End Sub
Private Sub CL_Résultat(Lignes() As Long)
Dim TLBx(), LL&, TDon(), LD&
TLgn = Lignes
TDon = CL.PlgTablo.Value
ReDim TLBx(1 To UBound(TLgn), 1 To 3)
For LL = 1 To UBound(TLgn)
LD = TLgn(LL)
TLBx(LL, 1) = TDon(LD, 1)
TLBx(LL, 2) = TDon(LD, 2)
TLBx(LL, 3) = TDon(LD, 3)
Next LL
ListBox1.ListIndex = -1
ListBox1.List = TLBx
End Sub
Private Sub ListBox1_Click()
LCou = TLgn(ListBox1.ListIndex - 1)
TVL = CL.Lignes(LCou).Range.Value
CL.ValeursDepuis TVL
CA.VAleursDepuis TVL
End Sub