Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-03-2018, 05:33 PM
andxie andxie is offline Populate TextBox from ListBox Windows 7 64bit Populate TextBox from ListBox Office 2013
Novice
Populate TextBox from ListBox
 
Join Date: May 2018
Posts: 15
andxie is on a distinguished road
Default Populate TextBox from ListBox

Hi,



I would like to know how could I populate multiple textboxes when an item on the listbox has been clicked? See attched image.

also how could I edit the data by just clicking on the item on the listbox?

Thank you
Attached Images
File Type: png sample.PNG (25.8 KB, 27 views)
Reply With Quote
  #2  
Old 07-03-2018, 06:57 PM
NoSparks NoSparks is offline Populate TextBox from ListBox Windows 7 64bit Populate TextBox from ListBox Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

Short answer.... use the list boxes Click event.

Where is the data to be loaded into the text boxes in relation to what shows in the list box ?

A sample Excel file would be more beneficial than a picture.
Reply With Quote
  #3  
Old 07-04-2018, 12:09 AM
andxie andxie is offline Populate TextBox from ListBox Windows 7 64bit Populate TextBox from ListBox Office 2013
Novice
Populate TextBox from ListBox
 
Join Date: May 2018
Posts: 15
andxie is on a distinguished road
Default

Here is the sample file.
Attached Files
File Type: xlsx Sample.xlsx (11.0 KB, 12 views)
Reply With Quote
  #4  
Old 07-04-2018, 06:27 AM
NoSparks NoSparks is offline Populate TextBox from ListBox Windows 7 64bit Populate TextBox from ListBox Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

Code:
Private Sub ListBox1_Click()
Me.TextBox1.Value = Application.WorksheetFunction.VLookup(ListBox1.Value, Range("B2:E3"), 3, False)
End Sub
Reply With Quote
  #5  
Old 07-08-2018, 04:56 PM
andxie andxie is offline Populate TextBox from ListBox Windows 7 64bit Populate TextBox from ListBox Office 2013
Novice
Populate TextBox from ListBox
 
Join Date: May 2018
Posts: 15
andxie is on a distinguished road
Default

how do I show all the details about that product on all the textboxes?
Reply With Quote
  #6  
Old 07-09-2018, 07:04 AM
NoSparks NoSparks is offline Populate TextBox from ListBox Windows 7 64bit Populate TextBox from ListBox Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

The suggestion is one way to populate a textbox based on the listbox selection.
Do the same for each textbox.

Your example file is nothing like your picture.
Is it reasonable to presume it's a VBA user form ?
Reply With Quote
  #7  
Old 07-16-2018, 01:47 AM
Debaser's Avatar
Debaser Debaser is offline Populate TextBox from ListBox Windows 7 64bit Populate TextBox from ListBox Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

If you load all the data into the listbox initially (you can hide any columns you don't want displayed), then you can simply access the List property of the listbox directly to assign any column to another control, rather than having to access the worksheet again.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate listbox eduzs Word VBA 4 07-18-2017 05:28 PM
This is a Userform LIstbox queston: A variable does not set to the value of a listbox CatMan Excel Programming 14 08-18-2014 08:14 PM
Populate TextBox from ListBox This is a Userform LIstbox queston: A variable does not set to the value of a listbox CatMan Excel 1 08-08-2014 09:41 AM
how to populate textbox based on combobox selection in word IvanGeorgiev Word 1 02-21-2013 07:32 PM
Populate TextBox from ListBox how to populate textbox based on combobox selection in word IvanGeorgiev Word VBA 1 02-21-2013 07:28 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:27 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft