Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default 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
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
Listbox Question Greg B Excel Discussion (Misc queries) 1 March 9th 05 02:17 PM
Listbox Question Greg B Excel Worksheet Functions 1 March 9th 05 02:17 PM
Listbox Question Greg B Excel Worksheet Functions 0 March 9th 05 12:46 AM
ListBox Question Randal W. Hozeski Excel Programming 7 December 20th 03 09:59 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM


All times are GMT +1. The time now is 01:18 PM.

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

About Us

"It's about Microsoft Excel"