PC Review


Reply
Thread Tools Rate Thread

Assign Excel Menu to Shortcut Key

 
 
Joshua
Guest
Posts: n/a
 
      17th Dec 2008
How do I assign an Excel menu item to a shortcut using VBA?

For example, I would like to add a procedure that inserts a worksheet
when the user presses Ctrl + Shift + I, instead of having to go to
through the native excel commands of Alt, then I, then W, or using the
mouse to navigate to Insert, then Worksheet

Thanks,

Joshua.
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      17th Dec 2008
Hi Joshua

Use Shift F11 to insert a new worksheet



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Joshua" <(E-Mail Removed)> wrote in message news:d1a61f0f-6e95-4929-9993-(E-Mail Removed)...
> How do I assign an Excel menu item to a shortcut using VBA?
>
> For example, I would like to add a procedure that inserts a worksheet
> when the user presses Ctrl + Shift + I, instead of having to go to
> through the native excel commands of Alt, then I, then W, or using the
> mouse to navigate to Insert, then Worksheet
>
> Thanks,
>
> Joshua.

 
Reply With Quote
 
Joshua
Guest
Posts: n/a
 
      17th Dec 2008
On Dec 17, 12:40*pm, "Ron de Bruin" <rondebr...@kabelfoon.nl> wrote:
> Hi Joshua
>
> Use Shift F11 to insert a new worksheet
>
> --
>
> Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm
>
> "Joshua" <joshua.moa...@gmail.com> wrote in messagenews:d1a61f0f-6e95-4929-9993-(E-Mail Removed)...
> > How do I assign an Excel menu item to a shortcut using VBA?

>
> > For example, I would like to add a procedure that inserts a worksheet
> > when the user presses Ctrl + Shift + I, instead of having to go to
> > through the native excel commands of Alt, then I, then W, or using the
> > mouse to navigate to Insert, then Worksheet

>
> > Thanks,

>
> > Joshua.


I would like to do this for a variety of native excel menu commands.
How do you call a native excel menu command in VBA using a keyboard
shortcut?

Thanks,

J
 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      17th Dec 2008
Hi Joshua

You must build a macro that will do the same and asign a shortcut to that macro
Or call the menu item in a macro like this

Sub insertsheet()
Application.CommandBars("Worksheet Menu Bar").FindControl _
(ID:=852, Recursive:=True).Execute
End Sub


You can find the ID numbers on this page (see also OLE's add-in
http://www.rondebruin.nl/menuid.htm





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Joshua" <(E-Mail Removed)> wrote in message news:388b543e-7987-4d31-b1d5-(E-Mail Removed)...
On Dec 17, 12:40 pm, "Ron de Bruin" <rondebr...@kabelfoon.nl> wrote:
> Hi Joshua
>
> Use Shift F11 to insert a new worksheet
>
> --
>
> Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm
>
> "Joshua" <joshua.moa...@gmail.com> wrote in messagenews:d1a61f0f-6e95-4929-9993-(E-Mail Removed)...
> > How do I assign an Excel menu item to a shortcut using VBA?

>
> > For example, I would like to add a procedure that inserts a worksheet
> > when the user presses Ctrl + Shift + I, instead of having to go to
> > through the native excel commands of Alt, then I, then W, or using the
> > mouse to navigate to Insert, then Worksheet

>
> > Thanks,

>
> > Joshua.


I would like to do this for a variety of native excel menu commands.
How do you call a native excel menu command in VBA using a keyboard
shortcut?

Thanks,

J
 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      17th Dec 2008
Record a macro whilst performing a task with a native menu command.

Assign a shortcut key to that macro.

From your example, recording inserting a worksheet returns this code.

Sub Macro1()
Sheets.Add
End Sub

But I would first see Help on keyboard shortcuts...........many native
commands already have shortcut keys.

Like Shift + F11 to insert a new sheet.


Gord Dibben MS Excel MVP

On Wed, 17 Dec 2008 10:44:29 -0800 (PST), Joshua <(E-Mail Removed)>
wrote:

>On Dec 17, 12:40*pm, "Ron de Bruin" <rondebr...@kabelfoon.nl> wrote:
>> Hi Joshua
>>
>> Use Shift F11 to insert a new worksheet
>>
>> --
>>
>> Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm
>>
>> "Joshua" <joshua.moa...@gmail.com> wrote in messagenews:d1a61f0f-6e95-4929-9993-(E-Mail Removed)...
>> > How do I assign an Excel menu item to a shortcut using VBA?

>>
>> > For example, I would like to add a procedure that inserts a worksheet
>> > when the user presses Ctrl + Shift + I, instead of having to go to
>> > through the native excel commands of Alt, then I, then W, or using the
>> > mouse to navigate to Insert, then Worksheet

>>
>> > Thanks,

>>
>> > Joshua.

>
>I would like to do this for a variety of native excel menu commands.
>How do you call a native excel menu command in VBA using a keyboard
>shortcut?
>
>Thanks,
>
>J


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I assign a CTRL + shortcut key to a menu item (paste speci. PaulGB Microsoft Excel Misc 1 14th Jul 2008 03:19 AM
Assign shortcut key to existing Excel Macro PatCos Microsoft Excel Programming 1 12th Jun 2008 12:00 AM
Help with shortcut menu in Excel =?Utf-8?B?SGVsZW4=?= Microsoft Excel Misc 1 14th Feb 2007 08:15 PM
How do I assign a shortcut key to an existing macro in Excel 2003. =?Utf-8?B?bnRhaGFsbA==?= Microsoft Excel Misc 1 11th Oct 2004 02:21 PM
Assign shortcut key to custom menu in Word =?Utf-8?B?R2FuZXRo?= Microsoft Word New Users 2 22nd Apr 2004 03:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:47 PM.