Page 1 of 1

Input to enter data in spreadsheet and repeat

Posted: Nov 21st, ’17, 21:13
by nicnaq
Using Excel 2016. I enter a lot of data that repeats. Is there a way to have a repeater such that it takes two inputs where Input 1 is the data and input 2 is a number (number of times to repeat). For example, I would like to enter the word "final" and then enter 42 and have it repeat "final" for 42 rows.

Re: Input to enter data in spreadsheet and repeat

Posted: Nov 22nd, ’17, 09:22
by Tom
This script will do it. Set it as a new shortcut, Type: Command:

Code: Select all

gui, MyGui:Default
gui, add, text,, Text
gui, add, edit, xp+50 yp vtext
gui, add, text, xm, Times
gui, add, edit, xp+50 yp w40 vtimes
gui, add, button, w75 gExecuteIt default, OK
gui, add, button, w75 xp+80 yp gMyGuiCancel, Cancel
gui, show
return

ExecuteIt:
gui, submit
loop % times
	sendinput %text%{Enter}
gui, MyGui:Destroy
return

MyGuiCancel:
MyGuiGuiClose:
MyGuiGuiEscape:
gui, MyGui:Destroy
return

Re: Input to enter data in spreadsheet and repeat

Posted: Nov 22nd, ’17, 19:06
by nicnaq
Thank you so much. This works great.
I do have a question: Is there a way to speed up the way it pastes the copies? It seems like there is a lag somewhere.

Re: Input to enter data in spreadsheet and repeat

Posted: Nov 23rd, ’17, 16:00
by Tom
Probably you would need to change some animation settings in Windows/Excel.
If you try it in Notepad, it is instant.