Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How to assign keyboard shortcut to existing Commandbar controls

Hi,

I wish to assign a keyboard shortcut (eg CTRL + SHIFT + D) to the command
control id 398, which changes the formatting of a cell to show another
decimal place.

Could you please show me how it's done?

Many thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to assign keyboard shortcut to existing Commandbar controls

Hi Superjas,

Copy the following macro into a standard module in your Personal.xls
workbook.

'=============
Public Sub IncreaseDecimals()
Application.CommandBars("Formatting"). _
FindControl(ID:=398).Execute
End Sub
'<<=============

Then, either assign the shortcut key combination to the macro manually or
try:

'=============
Public Sub Tester()
Const WbName As String = "Personal.xls" '<<==== CHANGE
Application.MacroOptions Macro:=WbName & "!IncreaseDecimals", _
Description:="", ShortcutKey:="D"
End Sub
'<<=============



---
Regards,
Norman


"superjas" wrote in message
...
Hi,

I wish to assign a keyboard shortcut (eg CTRL + SHIFT + D) to the command
control id 398, which changes the formatting of a cell to show another
decimal place.

Could you please show me how it's done?

Many thanks in advance!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How to assign keyboard shortcut to existing Commandbar control

Hi Norman,

That's awesome, exactly what I was after! Thankyou very much!!

Cheers!
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
Assign keyboard shortcuts Ms Excel Worksheet Functions 0 January 26th 09 12:59 AM
keyboard controls Leslie Excel Discussion (Misc queries) 4 August 12th 08 11:24 PM
How do I assign keyboard shortcut for Grouping? Christina_0123 Excel Discussion (Misc queries) 0 May 3rd 06 05:27 PM
Assign hyperlink to new commandbar control mabond Excel Programming 3 August 22nd 05 02:33 PM
CommandBar Controls Simon Shaw[_5_] Excel Programming 3 December 28th 04 05:05 PM


All times are GMT +1. The time now is 04:51 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"