Filter / Limit list by value chosen in another list?

mdavidge

Board Regular
Joined
Oct 14, 2005
Messages
87
Hello,

I have a list of territory numbers (A Column) and a list of customers (B Column). I would to create a lookup list where I can choose a specific territory number like 650 below. I would like to populate D Colum with only customers begining with "650". I would like this D Column list to change based on the chosen territory number from the drop list for territory.

Is this possible? I am racking my brain and unable to find a solution.

Thanks,
Mike
Book1
ABCD
1TERRASCEND CUSTTERR SELECTEDLIST C1 CUSTOMERS ONLY
2610610 Acustomer650
3620610 Bcustomer
4640610 Ccustomer
5650620 Acustomer
6660620 Dcustomer
7670620 Mcustomer
8680640 Ccustomer
9690640 Ecustomer
10640 Hcustomer
11650 Fcustomer
12650 Jcustomer
13650 Xcustomer
14660 Ccustomer
15660 Mcustomer
16670 Kcustomer
17670 Ocustomer
18680 Bcustomer
19680 Qcustomer
20690 Ecustomer
21690 Fcustomer
22690 Ycustomer
Sheet3
 
Mike

Are you trying to create cascading validation lists?

i.e. the validation list in D2 is based on the value selected from the validation list in C2
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
All,

Tom received the file by e-mail recomended the following. Now the list works as intended. When a particular territory number is chosen in C2, only items from B with that territory number are listed in D.

Thanks to everyone for the help.

Mike :)

Tom Urtis Wrote

Do this:



From your worksheet, press Alt+F11.

Press Ctrl+G.



Enter

Application.EnableEvents = True

And press Enter



Pres Alt+Q to return to the worksheet.



Try the drop-down again in cell C2.
 
Upvote 0
The condsolidated solition to the problem from Tom Urtis is below.

If you are not using Excel97, then see if this helps. Right click on your sheet tab, left click on View Code, and paste the following procedure into the large white area that is the worksheet module. Press Alt+Q to return to the worksheet.



Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$C$2" Then Exit Sub
Application.ScreenUpdating = False
If IsEmpty(Target) Then
Range("D2:D" & Cells.Rows.Count).Clear
Exit Sub
End If
ActiveSheet.AutoFilterMode = False
Range("D2:D" & Cells.Rows.Count).Clear
Dim FilterRange As Range, LR&, FilterWhat$
LR = Cells(Rows.Count, 2).End(xlUp).Row
Set FilterRange = Range("B1:B" & LR)
FilterWhat = Target.Value
FilterRange.AutoFilter Field:=1, Criteria1:=FilterWhat & "*"
On Error Resume Next
With FilterRange
.Offset(1).Resize(.Rows.Count - 1).SpecialCells(12).Copy Range("D2")
End With
Err.Clear
ActiveSheet.AutoFilterMode = False
Application.ScreenUpdating = True
End Sub
_________________

Close the module and then from your worksheet, press Alt+F11.
Press Ctrl+G.

Enter
Application.EnableEvents = True
And press Enter

Pres Alt+Q to return to the worksheet.


Tom Urtis
 
Upvote 0

Forum statistics

Threads
1,216,069
Messages
6,128,599
Members
449,460
Latest member
jgharbawi

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