ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Call macro from active workbook-duplicate shortcut keys (https://www.excelbanter.com/excel-programming/288205-call-macro-active-workbook-duplicate-shortcut-keys.html)

James[_18_]

Call macro from active workbook-duplicate shortcut keys
 
I usually have several workbooks open at the same time, each with a
print macro with shortcut CTRL-P. When I press CTRL-P I want the print
macro from the active workbook to run. Often it will call the
procedure from a different (inactive) workbook, resulting in an error
message. How do make CTRL-P call the macro from the active workbook?

geo

Call macro from active workbook-duplicate shortcut keys
 
use ThisWorkbook or Activeworkbook object
-----Original Message-----
I usually have several workbooks open at the same time,

each with a
print macro with shortcut CTRL-P. When I press CTRL-P I

want the print
macro from the active workbook to run. Often it will call

the
procedure from a different (inactive) workbook, resulting

in an error
message. How do make CTRL-P call the macro from the

active workbook?
.



All times are GMT +1. The time now is 01:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com