Google apps script 为什么不';t与SpreadsheetApp.Sheet.getRange的方法签名不匹配

Google apps script 为什么不';t与SpreadsheetApp.Sheet.getRange的方法签名不匹配,google-apps-script,google-sheets-api,Google Apps Script,Google Sheets Api,我想将单元格值从b1复制到b2,但出现错误,请帮助解决此问题 function recordHistory() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var inputSheet = ss.getSheetByName("b1"); var source = inputSheet.getRange('B3','D3','F3','H3','J3','L3','N3','P3','R3','T3','V3'

我想将单元格值从b1复制到b2,但出现错误,请帮助解决此问题

   function recordHistory() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var inputSheet = ss.getSheetByName("b1");


var source = inputSheet.getRange('B3','D3','F3','H3','J3','L3','N3','P3','R3','T3','V3');
var values =

 source.getValues();

var outputSheet = ss.getSheetByName("b2");
outputSheet.getRange(outputSheet.getLastRow()+1,1,values.length,values[0].length).setValues(values);
};
异常:参数(字符串、字符串、字符串、字符串、字符串、字符串、字符串、字符串、字符串、字符串、字符串、字符串)与SpreadsheetApp.Sheet.getRange的方法签名不匹配。 recordHistory@RecordPercent.gs:6


<>你应该考虑使用< /P> getRange()方法有四个方法,最多可接受四个参数,本文将对此进行说明

function getAndSetValueWithRangeList() {
  const ss = SpreadsheetApp.getActive();
  const sh = ss.getSheetByName('b1');
  const osh = ss.getSheetByName('b2');
  let rlA = sh.getRangeList(['B3', 'D3', 'F3', 'H3', 'J3', 'L3', 'N3', 'P3', 'R3', 'T3', 'V3']);
  rlA.getRanges().forEach((r,i)=>{osh.getRange(r.getA1Notation()).setValue(r.getValue());});
}