class SpreadsheetApp method .deleteRows()

SpreadsheetApp is the Apps Script service.

.deleteRows() is the method name you will see after a dot in your code.

What it does

Deletes multiple rows starting at a given position.

Why it's used

  • Bulk-remove empty or duplicate rows after a cleanup pass.
  • Shrink a sheet after archiving old records elsewhere.

Common errors

  • Forgetting parentheses on deleteRows. Write SpreadsheetApp.deleteRows(), not SpreadsheetApp.deleteRows or deleteRows by itself.
  • Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').deleteRows().
  • Adding spaces where they do not belong. Write SpreadsheetApp.deleteRows(), not SpreadsheetApp .deleteRows(), SpreadsheetApp.deleteRows (), or SpreadsheetApp . deleteRows().
  • Wrong capitalization. Use SpreadsheetApp and deleteRows, not spreadsheetapp or deleterows.

Explore

Related methods

Better Sheets tutorials

No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.

Related blog posts

Written guides about SpreadsheetApp.deleteRows().

Browse the blog