PC Review


Reply
Thread Tools Rate Thread

Can I link multiple Listboxes to one Scrollbar

 
 
rachitm@gmail.com
Guest
Posts: n/a
 
      15th Apr 2007
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

 
Reply With Quote
 
 
 
 
Incidental
Guest
Posts: n/a
 
      16th Apr 2007
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the scrollbar/arrows size for Access listboxes. Minton M Microsoft Access Form Coding 2 20th Dec 2007 06:15 PM
Link two listboxes together greenfalcon Microsoft Excel Programming 2 5th Dec 2005 08:38 PM
Userform w/ Multiple listboxes that link miker1999 Microsoft Excel Programming 1 27th Apr 2004 03:22 AM
Userform w/ Multiple listboxes that link miker1999 Microsoft Excel Programming 2 20th Apr 2004 12:35 PM
Is there a way to link two listboxes together? Dominic Isaia Microsoft VB .NET 6 31st Oct 2003 06:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:58 PM.