Run a macro shortcut from another macro?

  • Thread starter Thread starter George J
  • Start date Start date
G

George J

I use Ctrl+n to run a macro

I now need to run this macro from another macro.
Tried using SendKeys "^%n", Wait:=True
but this didn't work. I cannot directly reference the
macro as there may be another workbook open (as
thisworkbook) that contains the same macro name but works
slightly differently - but if CTRL+n is pressed i have set
it up so that the macro from the activeworkbook will run.

can anyone help?
thanks
George
 
George

Consider using Application.Run to call it from the other workbook. You can
specify which workbook's macro to run.

Application.Run("Book1.xls!MyMacro")

MyMacro must be Public and in a standard module.
 

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