Hello all,
I am in the process of rewriting several macros authored by several previous authors. The first of three is launched from a button on an Access form. After the first has run, users are asked to paste data into the .xlsx workbook created by the first macro before running the second. To launch the second macro, users are asked to press "Ctrl + Shift + M". Similarly, after the user has finished cleaning up data, the third is run by pressing "Ctrl + Shift + N".
These shortcuts are designed unlike any others I've seen ... I've found a number of articles on similar functions to read the Key State and pass to a program, but I do not understand what is happening and the shortcuts are now broken.
Can anyone shed light on the following? Would it be easier to create and implement another approach?
Thanks,
I am in the process of rewriting several macros authored by several previous authors. The first of three is launched from a button on an Access form. After the first has run, users are asked to paste data into the .xlsx workbook created by the first macro before running the second. To launch the second macro, users are asked to press "Ctrl + Shift + M". Similarly, after the user has finished cleaning up data, the third is run by pressing "Ctrl + Shift + N".
These shortcuts are designed unlike any others I've seen ... I've found a number of articles on similar functions to read the Key State and pass to a program, but I do not understand what is happening and the shortcuts are now broken.
Can anyone shed light on the following? Would it be easier to create and implement another approach?
Thanks,
Code:
Function ShiftPressed() As Boolean
'Returns True if shift key is pressed
ShiftPressed = GetKeyState(SHIFT_KEY) < 0
End Function
Sub OCRMacroPart3()
'
' Keyboard Shortcut: Ctrl+Shift+M
'Allows the macro to be run when the key combo is pressed
Do While ShiftPressed()
DoEvents
Loop
Do Stuf
End Sub