Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Created April 22, 2021 17:09
Show Gist options
  • Save JoeGlines/b85552a6a7f7a19ba2e8e28056c91f56 to your computer and use it in GitHub Desktop.
Save JoeGlines/b85552a6a7f7a19ba2e8e28056c91f56 to your computer and use it in GitHub Desktop.
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey Udemy courses. They're structured in a way to make learning AHK EASY
; Right now you can get a coupon code here: https://the-Automator.com/Learn
;********************Copy selected text, activiate Excel & Paste****************
;***********Copy / Paste to other program
^b::
backup:=ClipboardAll ;create a backup of the clipboard
Clipboard:="" ;clear the clipboard
Send, ^c ;Send "Control C" to copy selected text
ClipWait,1 ;waiting for clipboard to have data
;~ MsgBox % Clipboard ;Show the clipboard has data
winactivate, ahk_exe EXCEL.EXE ;Activate Excel
WinWaitActive, ahk_exe EXCEL.EXE ;Wait for Excel to be activated
Send, ^v ;Send "Control V" to paste the data into Excel
sleep, 100 ;add 1-10th of a second to wait
Send, {down} ;send the down-arrow key to move cursor to cell below
sleep, 100 ;wait 1-10th of a second
winactivate, ahk_exe SciTE.exe ;Activate SciTE
Clipboard:=backup ;restore clipboard
return ;end this section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment