Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macros with switches
I have doubt with macro coding.
I have three macros to run. In first step: If user press a macro button it has to run the Macro1, after running this, there is one message box will popup asking for Yes or No Now question is If user select Ok it should run the macro2 and If user select No it should run the macro3. Just I want to know how to link the Macro 2 and Macro3 after message box message button. Should I use "Buttons" in between macros???????????????? I hope this make sense. Regards, Vishu |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macros with switches
Hi Vishu,
Whether to use msgbox's between macros is up to you, it depends on what you are trying to do and what reasons you may need to stop the macros for. To link them do the following: Before the End Sub in Macro1 put the following: If Msgbox("Would you like Macro2 to now run?", VBYesNo,"Macro2") = VbYes then Call Macro2 Endif You will need to replace Macro2 with what ever you have called it etc. You can put the same at the bottom of Macro2 changing the name of Macro2 to Macro3 etc. Regards, James |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macros with switches
ans = MsgBox("Yes or No"£, vbYesNo"
If ans = vbYes Then Call macro2 Else Call macro3 End If -- HTH Bob Phillips "vishu" wrote in message ... I have doubt with macro coding. I have three macros to run. In first step: If user press a macro button it has to run the Macro1, after running this, there is one message box will popup asking for "Yes" or "No" Now question is If user select "Ok" it should run the macro2 and If user select "No" it should run the macro3. Just I want to know how to link the Macro 2 and Macro3 after message box message button. Should I use "Buttons" in between macros???????????????? I hope this make sense. Regards, Vishu |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macros with switches
Hi Bob..
Thank you for your great help. regards vishu "Bob Phillips" wrote: ans = MsgBox("Yes or No"Β£, vbYesNo" If ans = vbYes Then Call macro2 Else Call macro3 End If -- HTH Bob Phillips "vishu" wrote in message ... I have doubt with macro coding. I have three macros to run. In first step: If user press a macro button it has to run the Macro1, after running this, there is one message box will popup asking for "Yes" or "No" Now question is If user select "Ok" it should run the macro2 and If user select "No" it should run the macro3. Just I want to know how to link the Macro 2 and Macro3 after message box message button. Should I use "Buttons" in between macros???????????????? I hope this make sense. Regards, Vishu |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macros with switches
sorry about the extraneous £
-- HTH Bob Phillips "vishu" wrote in message ... Hi Bob.. Thank you for your great help. regards vishu "Bob Phillips" wrote: ans = MsgBox("Yes or No"£, vbYesNo" If ans = vbYes Then Call macro2 Else Call macro3 End If -- HTH Bob Phillips "vishu" wrote in message ... I have doubt with macro coding. I have three macros to run. In first step: If user press a macro button it has to run the Macro1, after running this, there is one message box will popup asking for "Yes" or "No" Now question is If user select "Ok" it should run the macro2 and If user select "No" it should run the macro3. Just I want to know how to link the Macro 2 and Macro3 after message box message button. Should I use "Buttons" in between macros???????????????? I hope this make sense. Regards, Vishu |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
External app with switches in link | Links and Linking in Excel | |||
Formula switches to Text | Excel Discussion (Misc queries) | |||
Excel startup switches | Excel Discussion (Misc queries) | |||
Filter Switches vs Calculations? | Excel Discussion (Misc queries) | |||
Filter Switches vs Macro? | Excel Discussion (Misc queries) |