Multiple criteria from two data validation lists sets trigger for macro

biker9
biker9 used Ask the Experts™
on
Hello Experts,
I need a bit of code that will select a macro based upon user selection from two data validation lists, each list contains 4 choices. The macro is triggered upon a button click.
Thanks,
biker9 Criteria-sets-macro.xlsm
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2008

Commented:
Problem with your macros is the system will confuse them for cell names, etc. If you rename them, you can use the application.run.

Here is my update

Sub Button3_Click()

Application.Run "Macro" & [G11] & [G12]

End Sub

Sub MacroA1()

Range("G21") = "Test A1 OK"

End Sub


Sub MacroB1()

Range("G21") = "Test B1 OK"

End Sub

Open in new window


Thomas

Author

Commented:
Thomas,
when I run the code, I get an error msg "400" ?
tx,
Ray
Top Expert 2008

Commented:
Are you running it from personal.xls or the workbook where the button is?
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Top Expert 2008

Commented:
Are your sheets protected?

Try it with the file I tested
Criteria-sets-macro.xlsm

Author

Commented:
I now get a run time error 1004 with the file you sent.
Top Expert 2008
Commented:
My bad. Try this one
Copy-of-Criteria-sets-macro.xlsm

Author

Commented:
Perfect,
Thanks Thomas,

(ps. sorry..i thought i had closed this off a couple days ago)
Top Expert 2008

Commented:
No problem. Glad to help.

Thomas

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial