Option Explicit
Private WithEvents CL As ComboBoxLiées, LCou As Long, TVL()
Private Sub UserForm_Initialize()
Set CL = CBxL.Création.ComboBoxLiées
CL.Plage Feuil1
CL.Add ComboBox1, "Sociétés"
CL.Add ComboBox2, "Interventions"
CL.Add ComboBox3, "N° de Marchés"
CL.CouleurSympa
CL.Actualiser
End Sub
Private Sub CL_Change(ByVal Complet As Boolean, ByVal NbrLgn As Long)
If NbrLgn = 1 Then Exit Sub
LCou = 0
ReDim TVL(1 To 1, 1 To CL.PlgTablo.Columns.Count)
GarnirAutresContrôles
End Sub
Private Sub CL_Résultat(Lignes() As Long)
If UBound(Lignes) > 1 Then Exit Sub
LCou = Lignes(1)
TVL = CL.Lignes(LCou).Range.Value
GarnirAutresContrôles
End Sub
Private Sub GarnirAutresContrôles()
TextBox2.Value = TVL(1, 3)
TextBox3.Value = TVL(1, 4)
TextBox4.Value = TVL(1, 6)
TextBox5.Value = TVL(1, 7)
TextBox6.Value = TVL(1, 8)
End Sub