Clearing Dropdowns In A Worksheet

A

Aechelon

Hello, what i'm trying to do is this. I have some dropdown boxes from
the forms toolbar, not the control toolbar, in my sheet. I have these
boxes pulling from another sheet that i set up as a database. By using
the index command, i am able to pull various information from the
database sheet depending on the subject selected in the dropdown box.
What I want to do is set up a command button that will reset all the
dropdown boxes back to empty when pressed. I have searched for days
and can not figure this out. Please help!
 
A

Aechelon

Okay, i *FINALLY* got it to work. This is what i did:


Sub Button23_Click()

Dim db As ControlFormat

Set db = ActiveSheet.Shapes("Drop Down 9").ControlFormat

db.ListIndex = 0

End Sub

If there's a better way, i'm always ready to learn. Thanks.
 
T

Tom Ogilvy

Sub Button23_Click()
Dim drpdwn as DropDown
for each drpdwn in Activesheet.Dropdowns
drpdwn.Listindex = 0
Next
End Sub

for a single dropdown.

Sub Button23_Click()
Activesheet.DropDowns("Drop Down 9").ListIndex = 0
End Sub
 

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