macro adding

M

Mak

I have developed an Excel file with macro, which is passed to user. I want
to add coding in it by asking user to run another macro (my newly developed
macro). How can I do it?
Thank you very much in advance.
 
T

TWhizTom

Mark,

View the code and add a user prompt to the worksheet object on activate....

select case msgbox "Would you like to run my macro", vbyesno,"Macro Run
Confirmation"
Case vbYes
run your macro
Case vbNo
exit sub
end select
 
B

Bernie Deitrick

Sub ExistingMacro()
If MsgBox("Run my new macro?", vbYesNo) = vbYes Then NewMacroName
End Sub

Sub NewMacroName()
MsgBox "Hello from NewMacroName"
End Sub

HTH,
Bernie
MS Excel MVP
 
M

Mak

Thanks for your reply but not my wish. Maybe I mislead you.

I want to insert some codings from one Sub (in my newly developed Excel
file) to another Sub (in another Excel file). Any ideas?
 

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

Top