Populating Listbox based on ComboBox selection - VBA

JackDomino1

New Member
Joined
Apr 7, 2020
Messages
39
Office Version
  1. 365
Platform
  1. Windows
Hi,

Im looking to populate a list box (5 coloums) based on the selection a user makes in a combobox.

However, the options in the combobox are not unique, so there will be multiple sets of data to display.

NameAgeHair Colour
Jack
34​
Brown
Ben
23​
Blonde
Steve
45​
Grey
Jack
65​
Black
John
19​
Black
Ben
21​
Brown

Names are select-able in the combobox. But if the user selects "Jack", the lstbox needs to display two rows of data.

I have managed to make it return the information associated to the first entry which matches the selection criteria, but I am struggling to get it to work on multiple entries.

Thanks
 
A common problem is leading/trailing spaces, either in the data the combo looks at, or the data your trying to load to the listbox.
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
A common problem is leading/trailing spaces, either in the data the combo looks at, or the data your trying to load to the listbox.
Spot on!!! There was a trailing space! Its working perfect now.
Thank you for your patience. Glad that is working.

Thanks again
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,487
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top