Fill down - Google Apps Script for Spreadsheets

后端 未结 4 1732
甜味超标
甜味超标 2020-12-13 09:34

Is there a function that can fill down data to all empty cells from the row above?

If not, could anyone help me out with a Google Apps Script (or other solution) tha

4条回答
  •  情话喂你
    2020-12-13 10:16

    Use copyTo. I'll mostly adapt the answer I found about this in here:

      var sheet = SpreadsheetApp.getActiveSheet();
      var originRange = sheet.getRange("A1:B1");
      var target = sheet.getRange("A2:B");
      originRange.copyTo(target);
    

    This will auto-fill / expand the formulas in originRange to everything below, as with copy & paste.

提交回复
热议问题