Bonjour,
Je développe sur PC (windows XP & Excel 2003), une application en VBA, qui est utilisée sur Mac 10.6
Jai un souci de compatibilité avec un userform listes déroulantes qui fonctionne parfaitement sous XP, mais refuse sous MAC.
Voici le code de la macro.
Merci par avance pour votre aide
Je développe sur PC (windows XP & Excel 2003), une application en VBA, qui est utilisée sur Mac 10.6
Jai un souci de compatibilité avec un userform listes déroulantes qui fonctionne parfaitement sous XP, mais refuse sous MAC.
Voici le code de la macro.
Merci par avance pour votre aide
Bloc de code:
Dim f
Private Sub ListBox3_Click()
End Sub
Private Sub UserForm_Initialize()
Set f = Sheets("Produit_B")
Set mondico = CreateObject("Scripting.Dictionary")
For Each c In Range(f.[B4], f.[B65000].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.[B4], f.[B65000].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
Prestation = ListBox1.List(k, 0)
temp = c.Offset(, 1)
mondico(temp) = temp
End If
End If
Next k
Next c
Me.ListBox2.List = mondico.items
ActiveCell.Offset(0, -2) = Prestation
End Sub
Private Sub ListBox2_Change()
Me.ListBox3.Clear
For Each c In Range(f.[C4], f.[C65000].End(xlUp))
For k = 0 To Me.ListBox2.ListCount - 1
If Me.ListBox2.Selected(k) = True Then
Element = ListBox2.List(k, 0)
If c = Me.ListBox2.List(k, 0) Then Me.ListBox3.AddItem c.Offset(, 1)
End If
Next k
Next c
ActiveCell.Offset(0, -1) = Element
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
Private Sub Reinitialiser_Click()
Unload Me
UF_SelectionArticle.Hide
UF_SelectionArticle.Show
'solution trouvée pour l'instant : voir comment supprimer la sélection de TextBox1
'ListBox2.Clear
'ListBox3.Clear
End Sub
Dernière édition par un modérateur: