LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Removing Hotkey Assignment

I am attempting to set custom hotkey assignments by reading their values from
the user's column in a table:

UserName Sprinks Bob Default
MacroName
MacroA a b b
MacroB b a

If no value is listed, as in Default's MacroB, I would like to remove any
pre-existing hotkey assignment. The following code, however, is not working.
It shows the MsgBox statement but does not remove the hotkey assignment.
Can anyone explain what I'm doing wrong?

Thank you.

Sprinks


' If username or "DEFAULT" found, then assign macro hot keys
If intUserColumn < 0 Then

inti = 4 ' First row of macro names

Do
strMacroName = Cells(inti, 1)
strKey = fstrHotKey(Cells(inti, intUserColumn))
' fstrHotKey returns either the left-most letter or a blank string

If strKey = "" Then
' No or bad assignment; remove hotkey
MsgBox "Will remove hotkey for " & strMacroName
Application.MacroOptions Macro:=strMacroName,
HasShortcutKey:=False
Else
' Assign hotkey
Application.MacroOptions Macro:=strMacroName,
ShortcutKey:=strKey
End If
inti = inti + 1

Loop Until Cells(inti, 1) = ""

End If
 
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
excel2007 hotkey L@ja New Users to Excel 0 January 29th 08 12:23 PM
hotkey in usrform x taol Excel Programming 1 October 24th 06 10:26 AM
Global macro hotkey Mikus Excel Programming 1 August 17th 05 08:54 PM
is there a 'format painter' hotkey? david Excel Worksheet Functions 1 June 6th 05 01:31 AM
Alt + Enter hotkey - what does this do? R Avery Excel Programming 2 October 14th 04 05:23 PM


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