Swithces in Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top