Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
LIstbox Question
I am very knew to listboxs, i am trying to understand them. I have a
listbox reading a list of names from a range. On this sheet i have a listbox and two textboxes. I am trying to get it so when you select an item in the list box the first text box show the name of the person you selected in the listbox. The second textbox will show the value of that item in the listbox. For example if you selected the first name rich. The first textbook would show rich and the other one would show 0. How do i do this i am having trouble. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
LIstbox Question
Rich
Use the Change event of the listbox. Private Sub ListBox1_Change() Me.TextBox1.Text = Me.ListBox1.Value Me.TextBox2.Text = Me.ListBox1.ListIndex End Sub Right click on the sheet's tab and choose View Code. Use the drop down boxes at the top and choose ListBox1 and Change to get the Sub and End Sub statements. Change the names in the above code to the actual names of your controls. -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com "Rich Cooper" wrote in message ... I am very knew to listboxs, i am trying to understand them. I have a listbox reading a list of names from a range. On this sheet i have a listbox and two textboxes. I am trying to get it so when you select an item in the list box the first text box show the name of the person you selected in the listbox. The second textbox will show the value of that item in the listbox. For example if you selected the first name rich. The first textbook would show rich and the other one would show 0. How do i do this i am having trouble. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Listbox Question | Excel Discussion (Misc queries) | |||
Listbox Question | Excel Worksheet Functions | |||
Listbox Question | Excel Worksheet Functions | |||
ListBox Question | Excel Programming | |||
listbox.value not equal to listbox.list(listbox.listindex,0) | Excel Programming |