Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Swithces in Macro
Hi,
I have 3 macros to run. When user run first macro, it will ask for Yes or No option. If user select yes automatically 2 macro should run, If user selects No 3 macro should run. Can you please tell me how to write switches between these three macro? Regards, Vishu |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Swithces in Macro
Write them as functions and return the result. As an example
Sub Macro1() Dim ans ans = MsgBox("Macro1", vbYesNo) If ans = vbYes Then If Func2 = vbYes Then Func3 End If End If End Sub Function Func2() Dim ans ans = MsgBox("Func2", vbYesNo) Func2 = ans End Function Function Func3() Dim ans ans = MsgBox("Func3", vbYesNo) Func3 = ans End Function -- HTH RP (remove nothere from the email address if mailing direct) "vishu" wrote in message ... Hi, I have 3 macros to run. When user run first macro, it will ask for Yes or No option. If user select "yes" automatically 2 macro should run, If user selects "No" 3 macro should run. Can you please tell me how to write switches between these three macro? Regards, Vishu |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Editing a simple macro | Excel Worksheet Functions | |||
Can T Get Macro To Run! | New Users to Excel | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Help with macro looping and color query function | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) |