Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I link multiple Listboxes to one Scrollbar
Hi,
Is there a way to control multiple listboxes via just one forms Scrollbar? The number of rows in all the listboxes is the same. I appreciate all your help Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I link multiple Listboxes to one Scrollbar
Hi
I am not sure exactly what your after but i added three listboxes and a scroll bar to a userform and then ran the following code, not the nicest looking code but it should work Option Explicit Dim i As Integer Private Sub ScrollBar1_Change() i = ScrollBar1.Value 'pass the scroll bar value to an integer and then ListBox1.ListIndex = i 'pass that integer to each listbox.listindex value ListBox2.ListIndex = i ListBox3.ListIndex = i End Sub Private Sub UserForm_Initialize() ListBox1.RowSource = "a1:a27" ' these just setting a ref for the test ListBox2.RowSource = "b1:b27" ListBox3.RowSource = "c1:c27" ScrollBar1.Min = 0 'set the min as 0 due to listindex defaulting from 0 up ScrollBar1.Max = 26 'as above set the last number for your scrollbar keeping 'in mind that you are starting from 0 End Sub hope this is of some use to you S |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Link two listboxes together | Excel Programming | |||
Multiple Listboxes - Listbox2.value doesn't get set | Excel Programming | |||
how do I link a list of possible value to a scrollbar? | Excel Discussion (Misc queries) | |||
Userform w/ Multiple listboxes that link | Excel Programming | |||
Userform w/ Multiple listboxes that link | Excel Programming |