Multiple dependent combo boxes

Joined
Jun 25, 2012
Messages
5
Reaction score
0
Hi

I have a date field. I have two combo boxes. One for year and One for month.

I have already written code for the year combo box to show only the unique years represented in the date field.

I am now trying to make the month combo box show only months present in the year selected. Also the months need to be sorted from latest to oldest in each year.

For example:

Datefield
6/1/2012
5/1/2012
6/1/2011
4/1/2012
3/1/2011


Year combo box should show only 2011 and 2012.

If user selects 2011 for year then the month combo box should show June, March in that order

If user selects 2012 for year then the month combo box should show June, May, April in that order
 
Joined
Aug 1, 2012
Messages
16
Reaction score
0
Have you tried using Data Validation? You need to create dynamic named ranges and use these as the source for the Data Validation, the drop down list in each field will then have the information you want. I can't remember exactly where I found the advice, but this link http://www.get-digital-help.com/201...s-containing-unique-distinct-values-in-excel/ should help.

Your requirements are entirely achievable.

Regards

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top