Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Assign Excel Menu to Shortcut Key

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Assign Excel Menu to Shortcut Key

Hi Joshua

Use Shift F11 to insert a new worksheet



--

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


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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Assign Excel Menu to Shortcut Key

On Dec 17, 12:40*pm, "Ron de Bruin" wrote:
Hi Joshua

Use Shift F11 to insert a new worksheet

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm

"Joshua" wrote in ...
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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Assign Excel Menu to Shortcut Key

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" wrote in message ...
On Dec 17, 12:40 pm, "Ron de Bruin" wrote:
Hi Joshua

Use Shift F11 to insert a new worksheet

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm

"Joshua" wrote in ...
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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Assign Excel Menu to Shortcut Key

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
wrote:

On Dec 17, 12:40*pm, "Ron de Bruin" wrote:
Hi Joshua

Use Shift F11 to insert a new worksheet

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm

"Joshua" wrote in ...
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
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
how do I assign a CTRL + shortcut key to a menu item (paste speci. PaulGB Excel Discussion (Misc queries) 1 July 14th 08 03:19 AM
Assign shortcut key to existing Excel Macro PatCos Excel Programming 1 June 12th 08 12:00 AM
Run Excel macro from XP shortcut menu hmm Excel Programming 5 December 26th 07 07:50 AM
cannot right-click a shortcut menu in Excel John Excel Discussion (Misc queries) 10 April 18th 07 02:04 PM
Help with shortcut menu in Excel Helen Excel Discussion (Misc queries) 1 February 14th 07 08:15 PM


All times are GMT +1. The time now is 08:23 AM.

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

About Us

"It's about Microsoft Excel"