Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Remove all keyboard shortcut keys assigned to macros - an example

Hello,
No question here, just a procedure example for archive.

REMOVE ALL KEYBOARD SHORTCUT KEYS ASSIGNED TO MACROS IN EXCEL WORKBOOK
MODULES
an example:

Sub MacroKeyBoardShortcutsRemoveAll()
Dim li_CurrentLine As Integer
Dim li_ArguementsStart As Integer
Dim WbName, MacroName, FullName As String
Dim ls_Line As String
Dim l_Component As Object

On Error Resume Next
MacroName = ""
FullName = ""

' Look at each VB Component (form/class/module) in turn

For Each l_Component In Workbooks(1).VBProject.VBComponents

' Only look at modules. Other types a 2=Class,
3=Form,100=Worksheet

If l_Component.Type = 1 Then

' Work through each line of code in turn

For li_CurrentLine = 1 To
l_Component.CodeModule.CountOfLines
ls_Line = l_Component.CodeModule.Lines(li_CurrentLine,
1)

' Remove spaces from the start in case of indentation

ls_Line = Trim$(ls_Line)

' See if this line is what we want.

If Left$(ls_Line, 3) = "Sub" Then
li_ArguementsStart = InStr(ls_Line, "()")
If li_ArguementsStart 0 Then

MacroName = "!" & Trim$(Mid$(ls_Line, 4,
li_ArguementsStart - 4))
WbName = Workbooks(1).Name
FullName = WbName & MacroName
'This line below removes the keyboard
shortcuts. You may also
'delete all descriptions by adding after macro
name reference: Description:=""

Application.MacroOptions Macro:=FullName,
ShortcutKey:=""

End If

End If

Next li_CurrentLine
End If
Next l_Component
End Sub





Search Criteria:
Remove all keyboard shortcuts in workbook
Delete all keyboard shortcut keys in Excel
Purge keyboard short cut keys
Reset keyboard shortcut keys
Remove ShortcutKey assignments references

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
Macros will not run with shortcut keys Doug Excel Worksheet Functions 2 December 15th 09 09:33 PM
keyboard shortcut keys TJE Setting up and Configuration of Excel 1 June 6th 06 05:38 PM
Macros Shortcut keys WSW Setting up and Configuration of Excel 1 May 14th 06 01:47 PM
How to remove Keyboard Shortcut CTRL+D csilly1979 Excel Discussion (Misc queries) 3 February 10th 06 09:38 PM
Shortcut keys assigned to macros/functions in excel Aussie CPA Excel Worksheet Functions 8 September 13th 05 02:49 AM


All times are GMT +1. The time now is 11:00 PM.

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

About Us

"It's about Microsoft Excel"