Это то, что вы ищете?
function infoTransfer() {
const ss=SpreadsheetApp.getActive();
const sh=ss.getSheetByName('New Item Input Sheet');
const vs=sh.getDataRange().getValues();
const itemsAddedSheet=SpreadsheetApp.openById('SheetID');
const warehouseSheet=SpreadsheetApp.openById('SheetID');
const monthValue=byName.getRange('A2').getValue();
switch (monthValue){
case "January":
var sheet=itemsAddedSheet.getSheetByName('January');
var monthSheet=warehouseSheet.getSheetByName('January');
var archiveSheet=warehouseSheet.getSheetByName('Archive 2020');
break;
case "February":
var sheet=itemsAddedSheet.getSheetByName('February');
var monthSheet=warehouseSheet.getSheetByName('February');
var archiveSheet=warehouseSheet.getSheetByName('Archive 2020');
break;
case "March":
var sheet=itemsAddedSheet.getSheetByName('March');
var monthSheet=warehouseSheet.getSheetByName('March');
var archiveSheet=warehouseSheet.getSheetByName('Archive 2020');
break;
case "April":
var sheet=itemsAddedSheet.getSheetByName('April');
var monthSheet=warehouseSheet.getSheetByName('April');
var archiveSheet=warehouseSheet.getSheetByName('Archive 2020');
break;
case "May":
var sheet=itemsAddedSheet.getSheetByName('May');
var monthSheet=warehouseSheet.getSheetByName('May');
var archiveSheet=warehouseSheet.getSheetByName('Archive 2020');
break;
case "June":
var sheet=itemsAddedSheet.getSheetByName('June');
var monthSheet=warehouseSheet.getSheetByName('June');
var archiveSheet=warehouseSheet.getSheetByName('Archive 2020');
break;
case "July":
var sheet=itemsAddedSheet.getSheetByName('July');
var monthSheet=warehouseSheet.getSheetByName('July');
var archiveSheet=warehouseSheet.getSheetByName('Archive 2020');
break;
case "August":
var sheet=itemsAddedSheet.getSheetByName('August');
var sheet=warehouseSheet.getSheetByName('August');
var archiveSheet=warehouseSheet.getSheetByName('Archive 2020');
break;
case "September":
var sheet=itemsAddedSheet.getSheetByName('September');
var monthSheet=warehouseSheet.getSheetByName('September');
var archiveSheet=warehouseSheet.getSheetByName('Archive 2020');
break;
case "October":
var sheet=itemsAddedSheet.getSheetByName('October');
var monthSheet=warehouseSheet.getSheetByName('October');
var archiveSheet=warehouseSheet.getSheetByName('Archive 2020');
break;
case "November":
var sheet=itemsAddedSheet.getSheetByName('November');
var monthSheet=warehouseSheet.getSheetByName('November');
var archiveSheet=warehouseSheet.getSheetByName('Archive 2020');
break;
default:
var sheet=itemsAddedSheet.getSheetByName('December');
var monthSheet=warehouseSheet.getSheetByName('December');
var archiveSheet=warehouseSheet.getSheetByName('Archive 2020');
break;
}
sheet.getRange(1,1,vs.length,vs[0].length).setValues(vs);
sheet.getRange(2, 11, sheet.getLastRow()-1, 1).setValue(new Date()).setNumberFormat("mm/dd/yyyy hh:mm");
}
}
Непонятно, что вы будете sh делать с monthSheet и archiveSheet.
Возможно, я бы подумал сделать это следующим образом:
function infoTransfer() {
const ss=SpreadsheetApp.getActive();
const sh=ss.getSheetByName('New Item Input Sheet');
const vs=sh.getDataRange().getValues();
const itemsAddedSheet=SpreadsheetApp.openById('SheetID');
const warehouseSheet=SpreadsheetApp.openById('SheetID');
const monthValue=byName.getRange('A2').getValue();
const sheet=itemsAddedSheet.getSheetByName(monthValue);
const monthSheet=warehouseSheet.getSheetByName(monthValue);
const archiveSheet=warehouseSheet.getSheetByName('Archive 2020');
sheet.getRange(1,1,vs.length,vs[0].length).setValues(vs);
sheet.getRange(2, 11, sheet.getLastRow()-1, 1).setValue(new Date()).setNumberFormat("mm/dd/yyyy hh:mm");
}