Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Link two listboxes together


I have a quick question. I have a form with lets say 2 separet
listboxes on it. A lstBox1 and lstBox2. Now what i need these to do i
if you scroll down with list box1, listbox2 moves scrolls down as well
Really what i am trying to do is the two listboxes have data in the
that needs to relate to the information in the other one, I cant hav
one list box move because then all the data is in the wrong place...
for example

This is how its supposed to look

lstBox1 lstBox2
a a
b b
c c
d d

i cant have this happen, when scroll box1 is scrolled the info in box
does not move.

lstBox1 lstBox2

b a
c b
d c


Hopefully this is clear enough.

Thanks for your hel

--
greenfalco
-----------------------------------------------------------------------
greenfalcon's Profile: http://www.excelforum.com/member.php...fo&userid=1362
View this thread: http://www.excelforum.com/showthread.php?threadid=49082

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Link two listboxes together


i wonder if this is even possible


--
greenfalcon
------------------------------------------------------------------------
greenfalcon's Profile: http://www.excelforum.com/member.php...o&userid=13622
View this thread: http://www.excelforum.com/showthread...hreadid=490823

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Link two listboxes together

I don't know if it's possible, but why not just have multiple columns in one
listbox and make the listbox wide enough to show both. It seems like a much
easier solution.

But you could sync the listboxes after you leave one of them:

Option Explicit
Private Sub ListBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Me.ListBox1.TopIndex = Me.ListBox2.TopIndex
End Sub
Private Sub ListBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Me.ListBox2.TopIndex = Me.ListBox1.TopIndex
End Sub
Private Sub UserForm_Initialize()
Dim iCtr As Long
With Me.ListBox1
.IntegralHeight = True
For iCtr = 1 To 20
.AddItem "asdf" & iCtr
Next iCtr
End With
With Me.ListBox2
.IntegralHeight = True
.Top = Me.ListBox1.Top
.Height = Me.ListBox1.Height
For iCtr = 1 To 20
.AddItem "qwer" & iCtr
Next iCtr
End With
End Sub

greenfalcon wrote:

i wonder if this is even possible

--
greenfalcon
------------------------------------------------------------------------
greenfalcon's Profile: http://www.excelforum.com/member.php...o&userid=13622
View this thread: http://www.excelforum.com/showthread...hreadid=490823


--

Dave Peterson
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
listboxes [email protected] Excel Programming 2 March 30th 05 06:41 PM
listboxes [email protected] Excel Programming 3 February 22nd 05 04:01 PM
listboxes [email protected] Excel Programming 2 February 22nd 05 10:31 AM
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 01:35 PM.

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

About Us

"It's about Microsoft Excel"