Link to home
Start Free TrialLog in
Avatar of biker9
biker9Flag for Canada

asked on

Multiple criteria from two data validation lists sets trigger for macro

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
Avatar of nutsch
nutsch
Flag of United States of America image

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
Avatar of biker9

ASKER

Thomas,
when I run the code, I get an error msg "400" ?
tx,
Ray
Are you running it from personal.xls or the workbook where the button is?
Are your sheets protected?

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

ASKER

I now get a run time error 1004 with the file you sent.
ASKER CERTIFIED SOLUTION
Avatar of nutsch
nutsch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of biker9

ASKER

Perfect,
Thanks Thomas,

(ps. sorry..i thought i had closed this off a couple days ago)
No problem. Glad to help.

Thomas