Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
list alternatives to textboxes or merged cells in shared file | Excel Discussion (Misc queries) | |||
Selecting subsets using combo boxes or list boxes | Excel Discussion (Misc queries) | |||
Questions on combo boxes and list boxes. | New Users to Excel | |||
Problem with populating textboxes in relation to drop down list | Excel Programming | |||
Linking textboxes to cells with formulae | Excel Programming |