Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro shortcut keys

Is there a way you can list or print the shortcut keys
that you have assigned to macros?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Macro shortcut keys

Diane

you could try this "kludgy" technique


good luck

Tim

PS if this code won't work, am happy to send you the file
that work!

Option Explicit

'Because these procedures use the DataObject variable
type,
'you must have a reference set in your VBA project to the
Microsoft Forms 2.0 object library.
Declare Function GetForegroundWindow Lib "user32.dll" ()
As Long

Sub foo()
Dim testing
Dim bFound As Boolean
Dim iCounter As Integer
Dim iTotalMacroNo As Integer
Dim MacroNames(12, 2)

If IsVBEActive Then Exit Sub

Range("A9").Select

'testing = GetOffClipboard
'MsgBox testing
Application.SendKeys ("%TMM{TAB 2}{UP 12}{TAB}") 'set for
all open workboooks
Application.SendKeys ("{ESC 2}") 'quit

iCounter = 1
Do While bFound = False
DoEvents
Application.SendKeys ("{DOWN}")
Application.SendKeys ("%TMM") 'start
Application.SendKeys ("{TAB}{DOWN " & iCounter - 1 & "}
{TAB 8}")
'
Application.SendKeys ("{F2}{END}")
Application.SendKeys ("+{HOME}")
Application.SendKeys ("^c")
Application.SendKeys ("{ESC}") 'quit
Application.SendKeys ("^v")

'Range("A20").Value = GetOffClipboard

'Range("A9").Offset(iCounter, 0).Select
'Application.SendKeys ("^v{DOWN}")
'Range("A9")(2, 1) = Range("A1").Value '"test" '.Offset
(iCounter, 1)
'Range("A9")(1 + iCounter, 1) = Range("A1") '.Select
'Application.SendKeys ("^v~")

'Cells(9 + iCounter, 2) = Range("a1")

If iCounter = 200 Then bFound = True
DoEvents
Application.SendKeys ("{DOWN}{UP}")

Debug.Print "iCounter = " & iCounter & " " &
Application.WorksheetFunction.CountIf(Range("A:A") ,
ActiveCell.Value)

If Application.WorksheetFunction.CountIf(Range("A:A") ,
ActiveCell.Value) 1 Then
bFound = True
ActiveCell.ClearContents
iTotalMacroNo = iCounter
End If







iCounter = iCounter + 1
Loop
'Exit Sub '
Range("B9").Select

For iCounter = 1 To iTotalMacroNo
Application.CutCopyMode = False
ActiveCell.Copy
DoEvents
Application.SendKeys ("{DOWN}")
Application.SendKeys ("%TMM") 'start
Application.SendKeys ("{TAB}{DOWN " & iCounter - 1
& "}%o")
'
Application.SendKeys ("{F2}{END}")
Application.SendKeys ("+{HOME}")
Application.SendKeys ("^c")
Application.SendKeys ("{ESC 2}") 'quit
Application.SendKeys ("^v")

Next iCounter


'Application.SendKeys ("{ESC 2}")


'Range("A20").Value = GetOffClipboard

End Sub

Public Sub PutOnClipboard(Obj As Variant)
Dim MyDataObj As New DataObject
MyDataObj.SetText Format(Obj)
MyDataObj.PutInClipboard
End Sub


Public Function GetOffClipboard() As Variant
Dim MyDataObj As New DataObject
MyDataObj.GetFromClipboard
GetOffClipboard = MyDataObj.GetText()
End Function


Public Sub ClearClipboard()
Dim MyDataObj As New DataObject
MyDataObj.SetText ""
MyDataObj.PutInClipboard
End Sub




Function IsVBEActive() As Boolean
Dim hWndP1 As Long
Dim hWndP2 As Long
hWndP1 = Application.VBE.MainWindow.hwnd
'Find the active window
hWndP2 = GetForegroundWindow
IsVBEActive = (hWndP1 = hWndP2)
End Function


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro shortcut keys



thanks very much - I didn't realize it would be so complicated - i
thought it would be on a menu item that I didn't know about



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
macro will not run with shortcut keys Doug Excel Worksheet Functions 0 December 4th 09 07:41 PM
Shortcut Keys BACH Excel Discussion (Misc queries) 4 October 24th 08 01:09 AM
shortcut keys tomruffner Excel Discussion (Misc queries) 2 February 28th 07 02:20 PM
macro shortcut keys don't work andr01d Excel Discussion (Misc queries) 1 February 3rd 06 05:40 PM
Macro Shortcut Keys Nicolle K. Excel Discussion (Misc queries) 1 January 6th 05 04:55 PM


All times are GMT +1. The time now is 11:31 AM.

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"