重新排列行时参数列表后缺少)

时间:2018-12-21 13:27:21

标签: javascript google-apps-script

当我在下面调试我的代码时,在参数列表后出现缺少)的错误

function Update() {
  var returnSheet = 
  SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1');
  var rowCount = returnSheet.getLastRow();
  var rrCell = 'A' + rowCount;
  var rrCell2 = 'E' + rowCount;
  returnSheet.getRange(rrCell:rrCell2).moveTo(returnSheet.getRange("A2:E2"));
}

1 个答案:

答案 0 :(得分:1)

@Shilly找到了答案

  returnSheet.getRange(rrCell+':'+rrCell2).moveTo(returnSheet.getRange("A2:E2"));