Public WithEvents cmb As MSForms.ComboBox
Dim cl(1 To 3) As New Classecomb
Public Combosoeurs
Public T
Public indexo&
Public Function initcombo(uf, tabl)
Dim toutes(1 To 3), i&, z&, T
For i = 1 To 3
Set cl(i).cmb = uf.Controls("cmb" & i)
Set toutes(i) = uf.Controls("cmb" & i)
cl(i).T = tabl
cl(i).indexo = i
Next
For z = 1 To 3: cl(z).Combosoeurs = toutes: Next
End Function
Private Sub cmb_Click()
If indexo <= 2 Then 'on arrete la gestion du clik a la 2d
With Combosoeurs(indexo + 1)
.Clear
For a = 1 To UBound(T)
.Value = T(a, indexo + 1)
If T(a, indexo) = cmb.Value Then If .ListIndex = -1 Then .AddItem T(a, indexo + 1)
Next
.Value = ""
End With
End If
End Sub