Skip to content

Instantly share code, notes, and snippets.

@DaneWeber
Created April 4, 2016 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DaneWeber/f0749a1befc4b4592f0f7bd1f5872bd5 to your computer and use it in GitHub Desktop.
Save DaneWeber/f0749a1befc4b4592f0f7bd1f5872bd5 to your computer and use it in GitHub Desktop.
Especially when you have hidden rows/columns, this pastes into the visible cells, based on tabs and new lines.
#z::
KeyWait, LWin
KeyWait, RWin
Clip0 = %ClipBoardAll% ; Save formatted text for later
ExcelBound = %Clipboard%
Loop, parse, ExcelBound, `r`n
{
if A_LoopField =
continue
nonemptyline := A_LoopField
Loop, parse, nonemptyline, `t
{
Clipboard = %A_LoopField%
Sleep 50
Send ^v
Send {tab} ; Type TAB once per tab found
}
Send {enter} ; Type ENTER once per Windows-style new line.
}
Sleep 50
ClipBoard = %Clip0% ; Restore original ClipBoard
VarSetCapacity(Clip0, 0) ; Free memory
Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment