1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Option Explicit
Private Sub UserForm_Activate()
Dim Obj As Control
Set CollectFiltres = New Collection
For Each Obj In Me.Controls
If InStr(1, Obj.Name, "Filtre") > 0 Then Classe_Add CollectFiltres, Obj
Next Obj
End Sub
Private Sub Classe_Add(C As Collection, O As Control)
Dim Cl As ClsCmdeSTT
Set Cl = New ClsCmdeSTT
If TypeName(O) = "ComboBox" Then
'Call ChargerFiltres(Obj.Name, Me)
Set Cl.ListeFiltres = O
ElseIf TypeName(O) = "TextBox" Then
Set Cl.TexteFiltres = O
End If
Cl.Nom = O.Name
C.Add Array(Cl, O), O.Name
End Sub |
Partager