ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Listbox Problem (https://www.excelbanter.com/excel-programming/441717-listbox-problem.html)

Martin Parker[_2_]

Listbox Problem
 
I have a listbox which is populated with data from a worksheet (column count
= 5)

As the 6th column is a descriptive text field, I would like to hold the data
of the 6th column in another listbox on the same userform.

When the user clicks on the rows in the first listbox, I would like the 6th
column text field to show in the 2nd listbox.

Can anyone help me understand how I can make this happen.

Thanks.

p45cal[_248_]

Listbox Problem
 

Some clarification needed. When you say

When the user clicks on the rows in the first listbox, I would like the
6th column text field to show in the 2nd listbox

do you want:




- For repeated clicks on a row in th 1st listbox to keep adding the
same information to the second listbox ending up with similar rows in
the second listbox?
- Will you instead want to allow multiple selections in the first
list box and only display what's selected in the first list box in the
second listbox?
- Add only once to the second listbox any row clicked in the first
listbox?
- Show only one row in the second listbox, that being the last
clicked row in the first listbox?


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?u=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=196102

http://www.thecodecage.com/forumz


Martin Parker[_2_]

Listbox Problem
 
Thanks for your quick reply, I would like to show only one row in the second
listbox, that being the last clicked row in the first listbox.

Cheers

"p45cal" wrote:


Some clarification needed. When you say


When the user clicks on the rows in the first listbox, I would like the
6th column text field to show in the 2nd listbox

do you want:




- For repeated clicks on a row in th 1st listbox to keep adding the
same information to the second listbox ending up with similar rows in
the second listbox?
- Will you instead want to allow multiple selections in the first
list box and only display what's selected in the first list box in the
second listbox?
- Add only once to the second listbox any row clicked in the first
listbox?
- Show only one row in the second listbox, that being the last
clicked row in the first listbox?


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?u=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=196102

http://www.thecodecage.com/forumz

.


p45cal[_249_]

Listbox Problem
 

VBA Code:
--------------------


Private Sub ListBox1_Click()
ListBox2.Clear
ListBox2.AddItem Range(ListBox1.RowSource).Offset(ListBox1.ListInde x, 5).Cells(1)
End Sub

--------------------


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?u=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=196102

http://www.thecodecage.com/forumz



All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com