PDA

View Full Version : Listbox and name manager comparison



zeki3131
06-11-2020, 06:10 AM
Hello,


this is my first mail, and I'm a total beginner. So if the question has been asked somewhere, I apologize in advance.


I have created a ListBox (Listbox1) in userform and put the name manager as source in it.
Depending on which list entry is selected, the entries of other ListBoxes change (quasi sublists also as name manager).
In the next step I would like to program the whole thing in such a way that if the selected sub-list combination is also present in another part of the main list box, then these others are displayed. Unfortunately I am missing any approach.
How can I compare the content of a ListBox with my list (from the name manager) ? Thank you very much.


This is my code yet.



Private Sub ListBox1_Click()
Dim x As Integer
x = ListBox1.ListIndex
Select Case x
Case Is = 0
ListBox2.RowSource = "Verfahren1"
ListBox3.RowSource = "Toleranz1"
ListBox4.RowSource = "Rautiefe1"
Case Is = 1
ListBox2.RowSource = "Verfahren2"
ListBox3.RowSource = "Toleranz2"
ListBox4.RowSource = "Rautiefe2"
Case Is = 2
ListBox2.RowSource = "Verfahren3"
ListBox3.RowSource = "Toleranz3"
ListBox4.RowSource = "Rautiefe3"
End Select
End Sub

snb
06-11-2020, 08:12 AM
Don't use .Rowsource to populate a combobox/listbox


Private Sub ListBox1_Click()
with Tabelle1.range("A1:A10")
ListBox2.List = .offset(,ListBox1.ListIndex)
ListBox3.List = .offset(15,ListBox1.ListIndex)
ListBox4.List = .offset(30,ListBox1.ListIndex)
End With
End Sub

zeki3131
06-11-2020, 08:27 AM
Why ?
Where is the difference between this 2 solutions?