Reputation: 2107
When I use 'Page 1!A1:A'
gives error in the script and does not clear all rows of COLUMN A
.
But when I put 'Page 1!A1:A200'
for example, it works perfectly.
But as the spreadsheet fluctuates in the number of rows, I cannot fix a value on the max quantity.
function Testes() {
var ss = SpreadsheetApp.getActive();
ss.getRange('Page 1!A1:A').clear({contentsOnly: true, skipFilteredRows: true});
};
How to adjust so that this no longer happens?
Upvotes: 0
Views: 39
Reputation: 64072
function Testes() {
var ss = SpreadsheetApp.getActive();
var sh=ss.getSheetByName('Page 1');
var rg=sh.getRange(1,1,sh.getLastRow(),1).clear({contentsOnly: true, skipFilteredRows: true});
}
Upvotes: 1