Macro keyboard shortcut will not execute in Excel 2007

rover8721

New Member
Joined
Jun 23, 2014
Messages
8
Hi all,

I'm a new member here and pretty new to Excel macros, in general. I created a very simple macro in Excel 2007 to copy the values from one fixed row to the current active cell (code is shown below). I've used other simple macros with keyboard shortcuts but it seems as though this particular macro will not be executed by a keyboard shortcut. I've tried several shortcut combinations and none seem to work - totally confused here. I've made a button to control the macro for now, but I would really like a keyboard shortcut as it would work significantly faster with my specific application.

Thanks!

HTML:
Sub ExpCopy()
'
' ExpCopy Macro
' Copies experimental details to sample.
'
' Keyboard Shortcut: Ctrl+Shift+M
'
    ActiveCell.Range("A1:BG1").Select
    Selection.Value = Range("$G4:$BM4").Value
End Sub
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hello

For me it works fine, though I use Excel 2013 now.

By the way, this is simpler in my opinion:

Code:
Sub ExpCopy()'
' ExpCopy Macro
' Copies experimental details to sample.
'
' Keyboard Shortcut: Ctrl+Shift+M
'
    ActiveCell.Resize(, 59).Value = Range("G4").Resize(, 59).Value
    
End Sub
 
Upvote 0
Hi Wigi,
Thanks for the quick response. I tried your suggested code and while it does perform the same operation, I'm still unable to employ a keyboard shortcut. Do you happen to have any further suggestions?

Thanks again.
 
Upvote 0
Not really, sorry, it should just work...
Do you have a whole range of shortcuts that refuses to work? Like for example Ctrl-q, that is one I often use.
Do you store the macro in your personal macro workbook?
 
Upvote 0
When I record a simple macro (rather than coding the example above), the same shortcut I used for the other example suddenly works. Yes, the macro is stored in my personal workbook.
 
Upvote 0
Just to check - you are adding the shortcut keys using the macros dialog?
 
Upvote 0
I've used the macros dialog as well as manually inserting them into code with the same result either way.
 
Upvote 0
You cannot simply add them to, or change them in, the code - it must be done through the macros dialog. (well, you can export the module and edit it in notepad and then re-import it, but the dialog is much easier!)
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,790
Members
451,589
Latest member
Harold14

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
Back
Top