Macro that changes Drop Down Box

P

peekbo

I am writing a macro that will execute each time the file is opened.
am doing this so that all the values reset to default values. However
I have nurmerous drop down boxes on the inputs page and cannot figur
out how or if its possible to have a macro select a value in a dro
down box.

Any thoughts or idea would be apprecaited.

Thanks,
Bria
 
B

Bob Phillips

Brian,

What sort of dropdowns?

If Data Validation, just set the value of the host cell.

If Forms combobox, Activesheet.DropDowns("Drop Down 1").ListIndex=3

If Control Toolbox, Activesheet.OLEObjects("Combobox1").object.Listindex=4

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
D

Dave Peterson

See another reply at your other post.

peekbo < said:
I am writing a macro that will execute each time the file is opened. I
am doing this so that all the values reset to default values. However,
I have nurmerous drop down boxes on the inputs page and cannot figure
out how or if its possible to have a macro select a value in a drop
down box.

Any thoughts or idea would be apprecaited.

Thanks,
Brian
 
P

peekbo

I got the dropdown forms to default to the value I needed, however, o
any drop down that had a huge number in its name it would not execute.
For example:
Sheets("Inputs").DropDowns("Drop Down 12").ListIndex = 1
Worked fine, however:
Sheets("Inputs").DropDowns("Drop Down 23483").ListIndex = 1
Did not work.

Any idea. The way I figure out what each drop down name was, wa
selected it and choosing assign macro to see what name it wa
assigning. Something else I noticed. On the drop downs with larg
numbers, it listed the whole file name before the drop down:
'Mission Profile Calculator - TEST - HIDE.xls'!DropDown2842_Change

However on the ones with small numbers, it only listed the dropdow
name:
DropDown12_Change

Any thoughts?

Bria
 
D

Dave Peterson

Try rightclicking on the dropdown and then look at the name box (to the left of
the formula bar).
 
Top