I'm making a script that copies the value of a cell in Excel and pastes it into anther Excel file. The script ask you in a inputbox how many cells you wish to copy, and then does the work.
But here's the problem.
If i hit "cancel" or the" close (x)" in the inputbox that comes up, the Script still runs.
I tried to put in an if/else, but I cant make it work.
Basically, I only want the script to run if I put a number value, else I want it to exit the script. Can someone guide me in the right direction? Thanks.
Here's my code, a bit simplified.
Code: Select all
Script:
F12loop = 10
inputbox, count, Cells to copy, How many cells do you want to copy?
Sleep, 3000
if (%count% > 0) {
sleep, 1500
loop, %F12loop% {
send, `t
sleep, 100
}
}
else {
send, {ESC}
}
Escape::ExitApp