Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Link two listboxes together greenfalcon[_8_] Excel Programming 2 December 5th 05 08:38 PM
Multiple Listboxes - Listbox2.value doesn't get set Dave F.[_5_] Excel Programming 0 November 29th 05 03:03 PM
how do I link a list of possible value to a scrollbar? philrogers Excel Discussion (Misc queries) 0 July 12th 05 02:46 PM
Userform w/ Multiple listboxes that link miker1999[_13_] Excel Programming 1 April 27th 04 03:22 AM
Userform w/ Multiple listboxes that link miker1999[_12_] Excel Programming 0 April 20th 04 12:35 PM


All times are GMT +1. The time now is 03:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"