class SpreadsheetApp method .deleteRow()

SpreadsheetApp is the Apps Script service.

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

What it does

Deletes a single row from the sheet.

Why it's used

  • Remove a single bad row after validation fails.
  • Delete the header row from a pasted import in one step.

Common errors

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

Explore

Related methods

  • .deleteRows()

    Deletes multiple rows starting at a given position.

  • .deleteSheet()

    Removes a sheet tab from the spreadsheet.

  • .appendRow()

    Adds a new row of data at the bottom of the sheet.

  • .insertRows()

    Inserts one or more blank rows at a given position.

  • .clear()

    Removes values, formatting, and notes from a range.

Better Sheets tutorials

Automated Project Management in Google Sheets

Automated Project Management in Google Sheets

Create automatic notifications when a project is assigned, a project nee...
Automate Google Sheets With Zero Experience

Automate Google Sheets With Zero Experience

By the end of this video you should be knowledgeable about how to automa...
Automate Move Blank Rows

Automate Move Blank Rows

Automate the apps script we just created that moves blank rows from one ...
Basic CRM - Add a Powerful Script To Move Row Based on Status

Basic CRM - Add a Powerful Script To Move Row Based on Status

we're going to be adding a very powerful script to our CRMs or any datab...

Related blog posts

Written guides about SpreadsheetApp.deleteRow().

Browse the blog