Shortcut key runs wrong code

ackey

Board Regular
Joined
Sep 24, 2004
Messages
75
Morning Experts

The VBA code to run all our company reports are run uses the same shortcut key (Ctrl r). This runs a Master routine which in turn runs a number of subroutines. This is fine when only one report is open at a time, however when the user has 2 or more such reports open, even though the only one may be the active workbook, sometimes it will run the code in one of the other workbooks. This is the case even if the settings are 'Macros in: This workbook'

Can anyone advise

Thanks in advance

Simon
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,723
I thought that shortcut keys operated on the first matching module in memory regardless of which workbook is active. In other words, this is expected behaviour in Excel, as far as I know.

What are the consequences when a macro in another book runs?
 
Upvote 0

Forum statistics

Threads
1,191,576
Messages
5,987,386
Members
440,095
Latest member
yanaungmyint

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top