Actions for dropdown list

  • Thread starter Thread starter lallo
  • Start date Start date
L

lallo

Hi,

How can I create actions for a dropdown list? For example, if I have
dropdown list (created with Data-Validation) containing element
weekdays and moths. When I choose weekdays from the list I want all th
days (monday, tuesday, ...) to appear next to the dropdown list. Th
cells containing the weekdays are located on sheet 2.

Thanks,
lall
 
Hi

What do you mean with 'next to dropdown list' ?

Anyway I' trying.
I assume you have weekday names in a column on sheet 2. And month names
also. Define both lists a named ranges (Insert.Name.Define), like
Weekday=Sheet2!$A$2:$A$8
Month=Sheet2!$B$2:$B$13

Into cell right to dropdown (let's it be B1, with dropdown in A1) enter the
formula
=IF(ISERROR(IF($A$1="Weekday",INDEX(Weekday,COLUMN(A1)),INDEX(Month,COLUMN(A
1)))),"",IF($A$1="Weekday",INDEX(Weekday,COLUMN(A1)),INDEX(Month,COLUMN(A1))
))
and copy it right so 12 cells contains the formula
 
Lallo;

What you want is not possible with Data Validation.
You create a UserForm and write some code with which you simulate that.
Based on a selection in your first list another list in the UserForm is
filled with items.

Might that be a solution ?

Mark.
 
Thanks Mark,

I think that is the way to do it. But how am I able to add that actio
to the dropdown list?

Is there a easier way to create and handle a dropdown list that usin
Tools.Macro.Microsoft Script Editor
 
lallo;

There's an example on my website.

www.rosenkrantz.nl

Excellent Files | Tips | Visual Basic | Fill a listbox from a combo box.

You can also do this with two list boxes.

Mark.
 
Back
Top