Run Macro from multiple drop downs & error if drop downs filled in incorrect order

audreylynn

New Member
Joined
Jan 24, 2018
Messages
1
I was unable to come up with a way to run a macro based on input from TWO drop down menus simultaneously. (if only one option chosen, no macro would run, BOTH actions have to occur before macro runs)

I have set a macro to run once user makes selection from first drop down and Macro1 runs and then the user makes a selection from second drop down and Macro2 runs. This order of operations is important. The second drop down selection cannot be made before the first drop down selection. Is there a way to code a msgbox to appear if user chooses value from second drop down menu before choosing value from first drop down menu?

TIA
 

Some videos you may like

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

stevieinselby

New Member
Joined
Nov 12, 2015
Messages
27
Just thinking out loud, I haven't tried it, but how about this?
- in Workbook_Open, define a variable and set the value to zero
- as part of Macro1, running after you select the first drop-down, change that variable to something other than zero
- in Macro2, add a condition that checks if the variable is still zero. If it is then abandon ship, because you know Macro1 has not been run.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,270
Messages
5,600,635
Members
414,398
Latest member
dhune

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top