I have a Google Spreadsheet with a sheet called Wrapped Sheet
for the responses collected from a Google Form. On every new added response (thus the onEdit function), I want to call the Wrap Text
option on all cells. I opened the script editor and created onEdit.gs
with the following code:
function onEdit(){
var activeSheet = SpreadsheetApp.getActiveSpreadsheet();
if(activeSheet.getName() == "Wrapped Sheet") {
var dataRange = activeSheet.getRange(1,1,data.length,headers.length);
dataRange.setWrap(true);
}
}
However, the function is not triggered on a new response. Additionally, calling it manually from within the script editor does not report any error.