View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default How to run code based on a dropdown form changing?

Use the ListIndex value of the ListBox. eg if there are four items in your
list, then they have a list index number that starts with 0:
0, 1, 2, 3. The code would look like this:

If ListBox1.ListIndex = 0 Then macro_name1
If ListBox1.ListIndex = 1 Then macro_name2
'etc for each item you want to run a macro
Mike F
"PropKid" wrote in message
...

I've used the validation dropdowns before but prefer the VBA form
because it automatically has the down arrow next it. The validation
dropdown only shows an arrow when it is selected.

I would like to run some code based on the selection chosen in the
dropdown form (which is inserted into the spreadsheet) when the
selection is changed.

Any assistance would be greatly appreciated!


--
PropKid
------------------------------------------------------------------------
PropKid's Profile:

http://www.excelforum.com/member.php...o&userid=10134
View this thread: http://www.excelforum.com/showthread...hreadid=271369