list box selection

rharri1972

Board Regular
Joined
Nov 12, 2021
Messages
132
Office Version
  1. 2019
Platform
  1. Windows
Hello!
I have listbox1 and a multipage on userform1. The Multipage has several tabs but I am focused only on one at the moment which is "ORDERS".

Listbox1 is populated with values from a range on worksheet "Customers" . Range is A2:G & last row.

each row in listbox1 is a different customer.

In the multipage tab of "ORDERS" i have another Listbox. (Here after named "Listbox2")

What I am trying to accomplish is this...first i have the LISTBOX1 listselection property set to single.
when i select a certain customer I need to populate "Listbox2".
This list box will get its population from any one of multiple worksheets depending on the Customer ID selected in Listbox1.

When I enter a customer order and Select the "OK" button. All data from the Customer Order Form is sent to a worksheet to be stored. The worksheet it is sent to, depends on that same Customer ID.

JUST TO NOTE: I have already created said worksheets with tabs titled after each customer id number.

The population of "Listbox2" will be determined by the Customer ID selected in ListBox1. Depending on this Customer ID in Listbox 1, it will determind the "activesheet" and then the range to populate "Listbox2" with.

To Clarify... Listbox 1 is populated with Customer ID, Customer Name, City, and State.

Lord i hope this make sense.

Thanks for any help!
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Could you upload a sample workbook (without sensitive data) to a sharing site like dropbox.com or google drive?
And then share the link here.
 
Upvote 0
Akuini....
my apologies... the way that I meant to ask this follows... I have tried to find tutorial but have had no luck... hope this help clarify.....

Is it possible to find and activate a certain worksheet based on a selection made from a listbox (Listbox1). Listbox1 has multiple columns but I want to reference the certain worksheet from data in the first column of the listbox which is Customer ID. Listbox1 has over 400 rows of customers. I have the multiselect property set to single. It will be the highlighting of or (single click) that would execute the subroutine.

example can be: Customer ID = ABC123 the worksheet would also be named ABC123.

I hope i have learned enough and have enough info on my cheat sheets to then populate another listbox on the same userform with a range of cells on the "ACTIVE WORKSHEET".

Also, there will be no need to clear the second Listbox at anytime as I want to see the information each time listbox1 is moved to a different customer.

As I stated, I have asked for help on this already, but didn't know quite how to ask for the help without scrambling everyone's minds. If this is possible, I would appreciate any help! Although

I have asked for help on here I have also tried doing my own research to no avail.

Thanks for any help!!
 
Upvote 0
Well, if you could provide a sample workbook I'll try to help you.
 
Upvote 0
Well, if you could provide a sample workbook I'll try to help you.
I don't have any code to reference or to show a sample of because I do not know how to put it together.

I think i am just trying to say...based on listbox.listindex (0).value find that worksheet that also has the same name as the value for the listindex(0) and activate it.

I have been trying to figure this out on my own but cannot so that is the reason i don't have a sample to show you.

I have been practicing with Customer ID BIRC1100 from the listbox and I have a worksheet named (in the tab) BIRC1100.
 
Upvote 0
I don't have any code to reference or to show a sample of because I do not know how to put it together.
I don't need the code, just the userform along with the listbox & sample data in the sheet.
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,274
Members
452,628
Latest member
dd2

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