Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Box Excel 2000

Status
Not open for further replies.

sbaxter

Technical User
Jul 18, 2003
2
US
I have a Form combo box with three entries and I would like the user to be able to use the dropdown arrow to pick from the list and then have the item picked execute a certain macro. Each entry from the combo box will have its own macro. Is there a way to do this or a simpler approach (I do not want to create three separate buttons)? Not real familar with VBA!!

Thanks
 
Try using a Select Case in the Change Event for your ComboBox. Something like.

Private Sub Your_ComboBox_Name_Change()

Select Case Your_ComboBox_Name.Value
Case First_List_Selection
MacroName1
Case Second_List_Selection
MacroName2
Case Third_List_Selection
MacroName3
Case Else
Exit Sub
End Select

End Sub

There are many other ways to do this, and If you plan on adding other selections to your list then this is more than likely not the best way. If, however, you are sure that there will only be three selections in your list then this is a pretty good way to do what you want to do. This is how I would do it anyway.

Hope this helps!





If you can't be "The Best", be the best at what you can!!!

Never say Never!!!
Nothing is impossible!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top