jetzt habe ich eine für mich gesehen spezielle Frage.
Ich habe eine UF mit zwei Listboxes. Ist es möglich, dass diese synchron gescrollt werden können?
Besten Dank für Eure Hilfe.
Gruss
Peter
Private nFocus As Long
Private Sub CommandButton1_Click()
For X = 1 To 300
ListBox1.AddItem "abc " & Rnd()
ListBox2.AddItem "abc " & Rnd()
Next X
Do While UserForm1.Visible
DoEvents
If nFocus = 1 Then
ListBox2.TopIndex = ListBox1.TopIndex
ElseIf nFocus = 2 Then
ListBox1.TopIndex = ListBox2.TopIndex
End If
Loop
End Sub
Private Sub ListBox1_Enter()
nFocus = 1
End Sub
Private Sub ListBox2_Enter()
nFocus = 2
End Sub
Private nFocus As Long
Private Sub ListBox1_Enter()
nFocus = 1
End Sub
Private Sub ListBox2_Enter()
nFocus = 2
End Sub
Private Sub UserForm_Activate()
Do While UserForm1.Visible
DoEvents
If nFocus = 1 Then
ListBox2.TopIndex = ListBox1.TopIndex
ElseIf nFocus = 2 Then
ListBox1.TopIndex = ListBox2.TopIndex
End If
Loop
End Sub
Gruß Werner