Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Call macro - duplicate shortcut keys

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.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Call macro - duplicate shortcut keys

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

--
Jim Rech
Excel MVP


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Call macro - duplicate shortcut keys

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.


"Jim Rech" wrote in message
...
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

--
Jim Rech
Excel MVP




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro will not run with shortcut keys Doug Excel Worksheet Functions 0 December 4th 09 07:41 PM
macro shortcut keys don't work andr01d Excel Discussion (Misc queries) 1 February 3rd 06 05:40 PM
Macro Shortcut Keys Nicolle K. Excel Discussion (Misc queries) 1 January 6th 05 04:55 PM
Call macro from active workbook-duplicate shortcut keys James[_18_] Excel Programming 1 January 16th 04 05:53 PM
Macro shortcut keys Diane Garrini Excel Programming 2 July 25th 03 12:29 PM


All times are GMT +1. The time now is 04:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"