I am new to this auto-hotkeys !
I need to create 3 shortcut keys for copying the selected text or data from browser and paste it in excel ,
there are 3 columns in excel , and three shortcut keys , if i press the first shortcut key the selected data should be pasted in the excel 1 column and if
i press the 2 shortcut key the text should be pasted in the 2 column like wise for 3 shortcut keys and after pasting the text when i do this action again the excel cell should automatically move to the new row and paste the text .
Serously i know my below code is a mess but please kindly help me in this !
Code: Select all
^q:: ;excel - populate row
oXl := ComObjCreate("Excel.Application")
oXl.Visible := True
oXl.Workbooks.Add
QuoteSelection()
{
selection:= GetSelection()
PasteText(Quote(selection))
}
;version 1 (simpler, for fewer cells)
vText := selection
Loop, Parse, vText, `t
oXl.Cells(1, A_Index) := A_LoopField
^W:: ;excel - populate row
oXl := ComObjCreate("Excel.Application")
oXl.Visible := True
oXl.Workbooks.Add
QuoteSelection()
{
selection:= GetSelection()
PasteText(Quote(selection))
}
;version 1 (simpler, for fewer cells)
vText := selection
Loop, Parse, vText, `t
oXl.Cells(1, A_Index) := A_LoopField
^e:: ;excel - populate row
oXl := ComObjCreate("Excel.Application")
oXl.Visible := True
oXl.Workbooks.Add
QuoteSelection()
{
selection:= GetSelection()
PasteText(Quote(selection))
}
;version 1 (simpler, for fewer cells)
vText := selection
Loop, Parse, vText, `t
oXl.Cells(1, A_Index) := A_LoopField