Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a database on a worksheet and a userform to search one column for a text string that the user puts in a textbox. The listbox shows just the filtered cells. I'd like the user to be able to select an item in the listbox and view further info for that item (ie the values of other cells in the same row). I'd put them as the caption of a label or some other "untouchable" way. For example the text search looks in the product decription (column B) and I'd like the user to see the product code (column A) and warehouse availability (Column E). -- David M |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
You need to put some code in the Listbox click event. I'll assume your RowSource for the listbox is in A1:B3, so you have three rows of 3 columns. In the width property for the listbox I'll assume columns 2 and 3 have 0 width so you can't see them (I THINK you do this with :0:0 in the width property - check the help). Then Private Sub Listbox1_Click() Dim i as integer With Listbox1 for i = 0 to .ListCount - 1 If .Selected(i) then Userform1.LB1.Text = .List(i,1) Userform1.LB2.Text = .List(i,2) End If Exit for next i End With End Sub If you double click your ListBox in the VBE you will see this event in the drop down menu at the top right (if it is not created for you on the click) regards Paul #DIV/0 wrote: Hi, I have a database on a worksheet and a userform to search one column for a text string that the user puts in a textbox. The listbox shows just the filtered cells. I'd like the user to be able to select an item in the listbox and view further info for that item (ie the values of other cells in the same row). I'd put them as the caption of a label or some other "untouchable" way. For example the text search looks in the product decription (column B) and I'd like the user to see the product code (column A) and warehouse availability (Column E). -- David M |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Move cell info and info in range of cells on new entry | Excel Discussion (Misc queries) | |||
Move cell info and info in neighboring cell on new entry | Excel Discussion (Misc queries) | |||
DISPLAYING INFO IN A LISTBOX | Excel Programming | |||
Data Entry Listbox | Excel Programming | |||
Disappearing listbox entry | Excel Programming |