Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Linking List Boxes and Textboxes


Good morning all,

On a userform, I want to link a listbox to several other textboxes on
the form so that when the listbox changes all of the other values in
the textboxes will change.

Listbox - Name - Textboxes = address, phone, etc...

How can I do this in Excel? Thanks!


--
peter_rivera
------------------------------------------------------------------------
peter_rivera's Profile: http://www.excelforum.com/member.php...o&userid=24495
View this thread: http://www.excelforum.com/showthread...hreadid=380885

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Linking List Boxes and Textboxes

Private Sub Listbox1_Click()
textbox1.Text = Listbox1.List(Listbox1.ListIndex,0)
textbox2.Text = Listbox1.List(Listbox1.ListIndex,1)
' etc

End Sub

--
Regards,
Tom Ogilvy


"peter_rivera"
wrote in message
news:peter_rivera.1qzhqq_1119369976.8997@excelforu m-nospam.com...

Good morning all,

On a userform, I want to link a listbox to several other textboxes on
the form so that when the listbox changes all of the other values in
the textboxes will change.

Listbox - Name - Textboxes = address, phone, etc...

How can I do this in Excel? Thanks!


--
peter_rivera
------------------------------------------------------------------------
peter_rivera's Profile:

http://www.excelforum.com/member.php...o&userid=24495
View this thread: http://www.excelforum.com/showthread...hreadid=380885



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Linking List Boxes and Textboxes


Thanks, the code works to a degree...
Instead of getting information (phones numbers, addresses) from the
linked worksheet, the textboxes merely copy what is in the listbox.

How do I correct this? Thanks!


--
peter_rivera
------------------------------------------------------------------------
peter_rivera's Profile: http://www.excelforum.com/member.php...o&userid=24495
View this thread: http://www.excelforum.com/showthread...hreadid=380885

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Linking List Boxes and Textboxes

Private Sub Listbox1_Click()
Dim rng as Range
set rng = Range(Listbox1.RowSource).Columns(1).Cells
set rng = rng(Listbox1.ListIndex + 1)
textbox1.Text = rng.Text
textbox2.Text = rng.offset(0,1).Text
textbox3.Text = rng.offset(0,2).Text
' etc

End Sub

--
Regards,
Tom Ogilvy


"peter_rivera"
wrote in message
...

Thanks, the code works to a degree...
Instead of getting information (phones numbers, addresses) from the
linked worksheet, the textboxes merely copy what is in the listbox.

How do I correct this? Thanks!


--
peter_rivera
------------------------------------------------------------------------
peter_rivera's Profile:

http://www.excelforum.com/member.php...o&userid=24495
View this thread: http://www.excelforum.com/showthread...hreadid=380885



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Linking List Boxes and Textboxes


Thanks Tom! It works now

--
peter_river
-----------------------------------------------------------------------
peter_rivera's Profile: http://www.excelforum.com/member.php...fo&userid=2449
View this thread: http://www.excelforum.com/showthread.php?threadid=38088

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
list alternatives to textboxes or merged cells in shared file UpTooLate37 Excel Discussion (Misc queries) 0 October 25th 06 05:12 AM
Selecting subsets using combo boxes or list boxes CLamar Excel Discussion (Misc queries) 0 June 1st 06 07:43 PM
Questions on combo boxes and list boxes. Marc New Users to Excel 1 March 14th 06 09:40 AM
Problem with populating textboxes in relation to drop down list Ben Allen Excel Programming 0 April 26th 04 09:40 PM
Linking textboxes to cells with formulae David Coleman[_2_] Excel Programming 7 December 29th 03 02:22 PM


All times are GMT +1. The time now is 04:52 AM.

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"