I am brand new to scripting.
I have a set of numbers in column X that I would like to (one at a time) have copied into cell T1, which will then return a result on Q11. I then want it to copy the result in Q11 and paste it on column Y next to the number originally copied from X
I have managed to start the below 2 different options, how do I get it to keep repeating the steps for every row of column X and Y?
Option 1:
function myFunction() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getRange('T1').activate();
spreadsheet.getCurrentCell().setFormula('=X1');
spreadsheet.getRange('Y1').activate();
spreadsheet.getRange('Q11').copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);
};
Option 2:
function myFunction2() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getRange('T1').activate();
spreadsheet.getRange('X1').copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_NORMAL, false);
spreadsheet.getRange('Y1').activate();
spreadsheet.getRange('Q11').copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);
};
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…