How to link the data from drop down lists

NeedtolearnMore

New Member
Joined
Mar 11, 2019
Messages
1
Good Afternoon,

Please note I'm very new to Excel..!

I have to create a master spread sheet that records the pallet number, the project names that are on each pallet and the serial numbers of the items that belong to each project.

I'm using column A to record pallet numbers. Pallet 1,2,3 etc. No problem so far.
I'm using a drop down box in column B to record the project name. Project Red, Blue, Green etc. I'm taking this data from sheet 2, inputting the information vertically in columns. No problem so far.
When I click the drop down list in column B and select a project that populates in the cell i.e. Project Blue, I then want a drop down list in column C to show me all of the serial numbers attached to that project, that I will be inputting in sheet 3 again vertically in columns.

I hope I have explained what I'm looking to do properly, I have tried to find a solution via Google but cant seem to find a similar scenario to mine.

Thank you for your time and patience!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Need_TLM,
Welcome to the Forum. To learn more on this topic just search 'Dependent Drop Downs'.

On sheet3 you need to create some Named Ranges.
Create a named range called 'Project Color' and select the header cells on sheet3 in that row for each color,
ie. Project Red, Project Blue, Project Green, and etc.
Still on Sheet3, create a named range for each color, the ranges could be named SN_Red, SN_Blue, and etc.
The range for each SN will be first SN to the last SN in each column without the header (Project Red or whatever).

On the sheet where you do your drop downs, I assume Sheet1,
B2 is the cell on sheet1 where the named range 'Project Color' is the 'Source' for the drop down.
C2 is the cell on sheet1 where the Serial Number is selected from a drop down.
The 'Source' for the 'List' in C2 is the formula: '=indirect($B$2)' without the single quotes.


On the sheet where you do your drop downs, I assume Sheet1,
Right click sheet tab > View Code to see Sheet Change Event Macro in the VB Editor window that opens.
Copy the following macro right over the existing two lines of code…without the bracketed 'Code' line.
Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
  If Intersect(Target, Range("B2")) Is Nothing Then Exit Sub
  Range("C2").ClearContents
  Range("C2").Select
End Sub


Close the VB Editor window, then save the file as macro enabled.
When you go to sheet 1 and select a Project Color from the drop down in B2,
you will then select a Serial Number from the drop down in C2.


When you reopen the file, you may have to enable macros again to run the macro depending on which version of Excel you are using.
Give that a try.
Perpa
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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