[Google Apps Script] Clear all values and formatting from a sheet

Created on November 30, 2026

Call clear() on a Sheet object to clear all of its cells, including their contents and formatting. This example clears the active sheet.

function clearSheet() {
  var sheet = SpreadsheetApp.getActiveSheet();
  sheet.clear();
}
Google Apps Script