I'm working on a sheet that cross references between two different Sheets. It works fine, but each sheet is around 10,000 entries, so it's checking...a lot. It takes about a half hour to check the whole thing. Which is fine, for the initial check.
That being said, I'm only adding new entries to the sheets every week, so having it check the entire thing is unnecessary. I think I know how to do this, I'm just not exactly sure how to write it.
My loop currently looks like this:
for (var i = 1; i < data1.length; i++) {
for (var j = 1; j < data2.length; j++) {
....
I'm guessing the way to do this is to create a variable, replace 1
with that variable, and have that variable be entered by the user. I can do that two different ways, I can call it from a cell in the sheet (which isn't ideal) or I can have a pop up show up before the script executes that allows a user to input the number.
I'm not very familiar with JavaScript, I took a class or two but I don't really know how to do this. Could someone help me out? I'm sure I need to truncate and sanitize my input too just in case and I have no idea how to do that at all.
Edit: After messing with it a bit more I added
var j = Browser.inputBox('Enter the number of the row to start on:')
Which should work (in theory) but for some reason if I do that I always end up with 0 results and I'm not sure why. I'll mess with it more, I suppose.