79382915

Date: 2025-01-24 00:08:56
Score: 1.5
Natty:
Report link

I just tried it myself on bound script against a basic sheet with data in a few columns and rows and it worked fine. It cleared only the data and left the formatting and data validation. The function was as follows :

function myFunction() {
  let sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1");
  let range = sheet.getRange(1,1,sheet.getLastRow(),sheet.getLastColumn());
  range.clear();
}

Are you running this bound, or unbound? How are you selecting the range?

Reasons:
  • Whitelisted phrase (-1): it worked
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Dan