I'm a newbie with GAS and this is my first question on Stackoverflow. Hopefully I can explain my question in a correct manor for you.
I have 2 sheets in 1 spreadsheet named "INPUT" & "DATA". On the INPUT sheet there is a named range called "ScanNr" (the value is always 18 digits)
The value of this named range needs to be copied to sheet DATA (col A) in a new row.
At the moment I'm using a MID-formula in sheet DATA (col B) to get a part of the scannr.
Can you help me adjust the script so I don't have to use a formula? An example of the current formula is "=MID(A5, 8, 4)"
This is my code sofar:
function SaveScan() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var myForm = ss.getSheetByName("INPUT");
var myData = ss.getSheetByName("DATA");
var myScan = myForm.getRange("ScanNr").getValue();
myData.getRange(myData.getLastRow()+1, 1).setValue(myScan);
// myData.getRange(myData.getLastRow(), 2) // ?? I don't know how to do this.
}
Any help will be highly appreciated.