Lié les scrollbar de 2 listbox
bonjour
Es ce possible de lié 2 scrollbars de 2 listbox.
C'est a dire quand je fait defilé une liste la deuxieme defile aussi au meme niveau. je veux lier la listbox LB_Demandeur avec LB-Gic.
j ai ce code d'initilisation.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Private Sub UserForm_Initialize()
'multiselection
Me.LB_Demandeur.MultiSelect = fmMultiSelectMulti
Set f = Sheets("BD")
'choix de liste
Set mondico = CreateObject("Scripting.Dictionary")
For Each c In f.Range("j2", f.[J65000].End(xlUp))
'sans doublon
If Not mondico.Exists(c.Value) Then mondico.Add c.Value, c.Value
Next c
Me.LB_Commune.List = mondico.items
'tri par orde alphabetique comunne
With LB_Commune
For i = 0 To .ListCount - 1
For j = 0 To .ListCount - 1
If UCase(.List(i)) < UCase(.List(j)) Then
temp = .List(j)
.List(j) = .List(i)
.List(i) = temp
End If
Next j
Next i
End With
End Sub |
j'ai essayé ca mais ca ne fonctionne pas
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| Private Sub LB_Gic_Click()
With LB_Demandeur
.TopIndex = LB_Gic.TopIndex
.ListIndex = LB_Gic.ListIndex
End With
End Sub
Private Sub LB_Demandeur_Click()
With LB_Gic
.TopIndex = LB_Demandeur.TopIndex
.ListIndex = LB_Demandeur.ListIndex
End With
End Sub |
merci pour votre aide