Using short cut key board combinations to run macro

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Using short cut key board combinations to run macro

Post by ABabeNChrist »

I may be reaching to the out most part of our universe but is it possible to use different short cut key board combinations to run a line of code. :scratch:

User avatar
HansV
Administrator
Posts: 78484
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Using short cut key board combinations to run macro

Post by HansV »

You can assign a keyboard shortcut to a macro: select the macro in the Macros dialog and click Options...
x258.jpg
You can't assign a keyboard shortcut to an individual line of code.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Using short cut key board combinations to run macro

Post by ABabeNChrist »

So if I were to start a macro then add some additional code, I could then use this approach

User avatar
HansV
Administrator
Posts: 78484
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Using short cut key board combinations to run macro

Post by HansV »

Not sure what you mean?
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Using short cut key board combinations to run macro

Post by ABabeNChrist »

Hi Hans
Let say I start recording a macro select “g” as my short cut, then press OK, then continue by let say selecting a cell, then stop recording. Now I open the macro to edit and then add more addition code to the already existing code.

User avatar
HansV
Administrator
Posts: 78484
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Using short cut key board combinations to run macro

Post by HansV »

You can assign a macro to a shortcut of the form Ctrl+character on keyboard or Shift+Ctrl+character on keyboard. You cannot assign a macro to the "g" key, for if you did that, you wouldn't be able to enter the letter "g" any more...

You can edit the macro any way you like; the keyboard shortcut will always run the current (latest) version of the macro.
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Using short cut key board combinations to run macro

Post by ABabeNChrist »

Thank you Hans
I apologize, I did mean with Ctrl+g on keyboard not just a letter.
I thank you for your most helpful assistance