Determining the last row in a single column

前端 未结 19 1259
野性不改
野性不改 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:24

    This is what worked for me:

    var ss = SpreadsheetApp.openById(YourSpreadsheetID);
    var main_sheet = ss.getSheetByName(YourMainSheet);
    main_sheet.getRange('K16').activate(); // substitute your cell from where you want to count
    main_sheet.getCurrentCell().getNextDataCell(SpreadsheetApp.Direction.DOWN).activate();
    var last_row_submissions = main_sheet.getCurrentCell().getRowIndex();
    
    0 讨论(0)
提交回复
热议问题