Determining the last row in a single column

前端 未结 19 1529
野性不改
野性不改 2020-11-22 10:46

I have a sheet with data in cols A through H.

I need to determine the last row in column A that contains data (it\'s all conti

19条回答
  •  故里飘歌
    2020-11-22 11:02

    This may be another way to go around lastrow. You may need to play around with the code to suit your needs

        function fill() {
          var spreadsheet = SpreadsheetApp.getActive();
          spreadsheet.getRange('a1').activate();
          var lsr = spreadsheet.getLastRow();
          lsr=lsr+1;
          lsr="A1:A"+lsr;
    
          spreadsheet.getActiveRange().autoFill(spreadsheet.getRange(lsr), SpreadsheetApp.AutoFillSeries.DEFAULT_SERIES);
    };
    

提交回复
热议问题