Re : faire d'une base de données plein de petite av des bouton ou choix de critère m
déja pour commencer est-ce qu'une écriture VBA peut etre retranscrite sur un autre dossier??
et sinon que veut dire :
- UserForm_Initialize()
- ListBox1_Change()
j'ai essayé de crée des liste de ce nom, ou de crée un bouton mais je n'arrive pas a retrouver l'écriture dés que je sors du mode création
Dim f
Private Sub UserForm_Initialize()
Set f = Sheets("BD")
Set mondico = CreateObject("Scripting.Dictionary")
For Each c In Range(f.[A2], f.[A65000].End(xlUp))
mondico(c.Value) = c.Value
Next c
Me.ListBox1.List = mondico.items
Me.ListBox1.MultiSelect = fmMultiSelectMulti
End Sub
Private Sub ListBox1_Change()
Me.ListBox3.Clear
Set mondico = CreateObject("Scripting.Dictionary")
For Each c In Range(f.[A2], f.[A65000].End(xlUp))
For k = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(k) = True Then
If c = Me.ListBox1.List(k, 0) Then
temp = c.Offset(, 1)
mondico(temp) = temp
End If
End If
Next k
Next c
Me.ListBox2.List = mondico.items
End Sub
Private Sub ListBox2_Change()
Me.ListBox3.Clear
For Each c In Range(f.[B2], f.[B65000].End(xlUp))
For k = 0 To Me.ListBox2.ListCount - 1
If Me.ListBox2.Selected(k) = True Then
If c = Me.ListBox2.List(k, 0) Then Me.ListBox3.AddItem c.Offset(, 1)
End If
Next k
Next c
End Sub
Private Sub b_ok_Click()
temp = ""
For k = 0 To Me.ListBox3.ListCount - 1
If Me.ListBox3.Selected(k) = True Then temp = temp & Me.ListBox3.List(k, 0) & " "
Next k
ActiveCell = temp
Unload Me
End Sub