Generating dynamic dropdown list in Excel

sumitn

New Member
Joined
Jan 19, 2010
Messages
5
Background information: I am using Excel 2003 on Windows XP.

I am trying to get a unique list to create a drop down list.

I have a sales report where Col A=Product Name, Col B=Month, Col C=Year, Col D=Total Sale Value.
I am using "Conditional Sum" to get the Total Sale amount from Col D for selected Product for specific month and year.

I have created a drop down list for Month & Year. What I am looking for a drop down box which shows all the Products meeting criteria (Month & Yr) which are unique and sorted meeting the above two criterias.
So, I want to create a dynamic drop down list showing only those Product names which has undergone sale in that month & year.

I have already used Advanced filter but that's not dynamic.

Any help would be appreciated.

Thanks
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Here's a basic layout that will create the "list" for you in column K without using any cumbersome array formulas. The key column E could be hidden if you wish...

Excel Workbook
ABCDEFGHIJK
1Product NameMonthYearSalesKeyMonthYearMaxName3
2Name122008$ 100.000420085Name9
3Name232009$ 200.000Name15
4Name342008$ 300.001Name21
5Name422009$ 400.001Name27
6Name532008$ 500.001
7Name642009$ 600.001
8Name722008$ 700.001
9Name832009$ 800.001
10Name942008$ 900.002
11Name1022009$ 1,000.002
12Name1132008$ 1,100.002
13Name1242009$ 1,200.002
14Name1322008$ 1,300.002
15Name1432009$ 1,400.002
16Name1542008$ 1,500.003
17Name1622009$ 1,600.003
18Name1732008$ 1,700.003
19Name1842009$ 1,800.003
20Name1922008$ 1,900.003
21Name2032009$ 2,000.003
22Name2142008$ 2,100.004
23Name2222009$ 2,200.004
24Name2332008$ 2,300.004
25Name2442009$ 2,400.004
26Name2522008$ 2,500.004
27Name2632009$ 2,600.004
28Name2742008$ 2,700.005
Sheet2



=========
Then to get a dynamic drop down list, create a named range called PRODUCTS using this: Refers To: =OFFSET(Sheet2!$K$1,0,0,MATCH("*",Sheet2!$K:$K,-1),1)

Use that name in a data validation drop down.
 
Upvote 0
Hi JB,

In addition to the Product, I need to put in a Sales Rep Name which is creating duplicate entries in the Dropdown list since Product Names are getting duplicated depending on the Sales Rep Names. Is there a way to remove the duplicate entries from Col K?

Thanks in advance.
 
Upvote 0
I have a VBA solution that allows you to dynamically change the filter you want to use.

VBA Code:
Sub MakeDropDown()
Dim myList$
Dim c As Range
myList = ""

For Each c In ActiveSheet.UsedRange.Columns(1).Cells
If c.Value Like "*" & Cells(2, 3).Value & "*" Then
myList = myList & c.Value & ","
End If
Next c

myList = Mid(myList, 1, Len(myList) - 1)
With Range("E2").Validation
.Delete
.Add _
Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Formula1:=myList
End With
End Sub
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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