Sequentially pasting from Excel - Major Noob Alert

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
hiimaustin
Posts: 1
Joined: 03 Jun 2023, 16:31

Sequentially pasting from Excel - Major Noob Alert

Post by hiimaustin » 03 Jun 2023, 16:45

Hello.
First off, this community and program is amazing. I can not believe that this is so powerful.
I also want to note that I have checked online, in these boards and I'm a bit confused on how to do this. I've gotten pretty far with what I'm looking for but I have three questions.

If you want to write the actual code, please do, but I will also take holistic directions as I don't believe in the "solve all my problems"


My goal: to automate a form filling but every time after it executes, it would go down one row and save the next cell in the clipboard.
First, lets say that I have an excel document of items.
ABC
DEF
GHI

It would then Save cell a1 in the clipboard, and then use it in the paste clipboard towards the end of the code.
It would then check for a certain color at a certain place on the screen and then loop, but this time, with 'DEF' or cell a2 in the clipboard, and so on until stopped by a manual keypress.

I currently have the following code, but these things are just a bit above what I understand. I'm sure some regex would be going on here - maybe?

Also this code is abysmal, I know its super struggling. I could take any help that yall will give. :)

Code: Select all

#SingleInstance force

^+e::

#NoEnv
			
SetWorkingDir C:\Users\me\location

CoordMode, Mouse, Screen
			
SendMode Input
			
#SingleInstance Force
			
SetTitleMatchMode 2
			
#WinActivateForce
			
SetControlDelay 1
			
SetWinDelay 0
			
SetKeyDelay -1
			
SetMouseDelay -1
			
SetBatchLines -1

sleep 100
MouseMove, -1060, 331, 2
			
sleep 100
			
sleep 4
			
Click, down
			
sleep 23
			
Click, up
			
sleep 15
MouseMove, -1060, 331, 2
		 
sleep 100
MouseMove, -1060, 331, 2
			
sleep 100
			
sleep 4
			
Click, down
			
sleep 23
			
Click, up
			
sleep 15
MouseMove, -1060, 331, 2

sleep 100
MouseMove, -996, 478, 2

sleep 100
			
sleep 4
			
Click, down
			
sleep 10
			
Click, up
   Sleep, 500
    SendInput, e
    Sleep, 50
    SendInput, {Tab}
    Sleep, 50
    SendInput, 05/01/2023
    Sleep, 50
    SendInput, {Tab}
 Sleep, 50
SendRaw %clipboard%
 Sleep, 50
	SendInput, {Tab}
    Sleep, 50
    clipboard:=SubStr(clipboard,1,9)
    SendInput, ^v
    Sleep, 50
    SendInput, {Tab}
    Sleep, 50
    SendInput, {Tab}
    Sleep, 50
    SendInput, {Tab}
    Sleep, 50
    SendInput, {Tab}
	    Sleep, 50
    SendInput, {Tab}
	    Sleep, 50
    SendInput, {Tab}
	    Sleep, 50
    SendInput, {Tab}
	    Sleep, 50
    SendInput, {Tab}
	    Sleep, 50
    sendInput, per client request
sleep 750
MouseMove, -1014, 881, 2

Click, down
			
sleep 10
			
Click, up

MouseMove, 248, 600, 2

return
[Mod edit: Replaced quote tags with [code][/code] tags.]

[Mod action: Moved topic to v1 section. The main section is for v2.]

User avatar
flyingDman
Posts: 2817
Joined: 29 Sep 2013, 19:01

Re: Sequentially pasting from Excel - Major Noob Alert

Post by flyingDman » 03 Jun 2023, 18:09

Something like this has been asked many times on the forum. If you search you'll get over 4000 results. Have a look.
14.3 & 1.3.7

Post Reply

Return to “Ask for Help (v1)”