Call macro - duplicate shortcut keys

  • Thread starter Thread starter John
  • Start date Start date
J

John

I'm still having problems with this. 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. Someone said to try thisworkbook but I couldn't get it to work
properly. How do make CTRL-P call the macro from the active workbook.
 
The first workbook opened with a shortcut key assigned to a macro (via
Tools, Macro, Macros) gets to keep it. If the macros are all the same you
might change them so that they always operates on the active workbook, as
opposed to a named workbook or ThisWorkbook.

Sub MyPrint()
ActiveSheet.Printout
End Sub
 
The macros have different dialog boxes. If I open a second workbook and
CTRL-P, the wrong dialog box is displayed (like you said, the first workbook
gets to keep it). Is there a way to display the dialog box from the active
workbook? There must be a workaround somehow.
 
Back
Top