Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
External app with switches in link Scott Links and Linking in Excel 1 April 3rd 07 11:11 AM
Formula switches to Text Tweedy Excel Discussion (Misc queries) 5 March 4th 07 11:28 PM
Excel startup switches Randy Excel Discussion (Misc queries) 9 June 14th 05 10:27 PM
Filter Switches vs Calculations? Ken Excel Discussion (Misc queries) 5 February 25th 05 05:11 PM
Filter Switches vs Macro? Ken Excel Discussion (Misc queries) 3 February 24th 05 10:31 PM


All times are GMT +1. The time now is 09:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"