Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
replied privately, but I'll put the fix here to finish off the thread Private Sub Listbox1_Click() With ListBox1 UserForm1.Label1.Caption = .List(.ListIndex, 1) UserForm1.Label2.Caption = .List(.ListIndex, 2) End With Me.Repaint End Sub regards Paul #DIV/0 wrote: Thanks again, The search part is working perfectly but the ListBox_Click only works with the first item. -- David M " wrote: Hi That makes more sense then! In the click event for the textbox you will need to run the code I put in the initialisation sub. The thing you are searching for will be Userform1.TB1.Text in your If Then Else regards Paul #DIV/0 wrote: The TextBox "Parole" is still empty when you open the form so the initialize function will do a search for nothing and populate the listbox with the whole column and nothing changes when I type the text to find. My way the form opens with an empty textbox and an empty list. I type the word to search for and click (which is how websearches do it so is the way people expect it to work). That populates the textbox with the full text only from those cells containing the word I want. Clicking on each item should display further details (as label captions) and as I see that's what you addressed with the very first post. Duh! Duh again! for missing the ColumnWidth in the properties window. I'll work on what you've given me and will post back. -- David M " wrote: Hi The way I suggested in an earlier post. Is the button you are clicking on the form with the listbox? If it is, then it is very strange to populate the listbox using a button on the same form - why not do the populating in the initialize sub as I suggested? Now use your button to run the lable changing code. regards Paul #DIV/0 wrote: Hang on. Figured it. I left ListBox1.ColumnCount = 3 ListBox1.ColumnWidths = ";0;0" in UserForm_Initialize and put all the rest in the button_Click Now I want the ListBox1_Click to put the values of the hidden columns into label captions. How do I do that ? ListIndex ? Offset ? -- David M |
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 |