Exceptions in deleting rows in a spreadsheet

I forgot where I used Row ID. Maybe I need to trace back. But what’s weird is that it also happens in sheet duplication, where row ID shouldn’t do anything.

Need to try. good advice.

1 Like

The strange thing is that I also have the query formula in another sheet (attendance), but no problem. Removed simultaneously in one action too.

This is needed in fact because I am using a checklist with a custom action to fill ##DELETE.

what do you mean??? and this adding extra rows is happening only when you run Darren’s code?

Right now. Initially, there may have been an array of formula leaks that led me to discover this oddity.
I’ll try again from the beginning to see if query is the source of the problem.

you wanna delete all empty rows, or just up to the last nonempty row?

Hahaha, now 3 sheets in multiple rows with ##Delete.
I need to rest first. :cold_sweat:

I wanna delete all empty rows, one by one. Anywhere to start.

//Remove All Empty Columns in the Entire Workbook
function removeEmptyColumns() {
var ss = SpreadsheetApp.getActive();
var allsheets = ss.getSheets();
for (var s in allsheets){
var sheet=allsheets[s]
var maxColumns = sheet.getMaxColumns();
var lastColumn = sheet.getLastColumn();
if (maxColumns-lastColumn != 0){
sheet.deleteColumns(lastColumn+1, maxColumns-lastColumn);
}
}
}

//Remove All Empty Rows in the Entire Workbook
function removeEmptyRows() {
var ss = SpreadsheetApp.getActive();
var allsheets = ss.getSheets();
for (var s in allsheets){
var sheet=allsheets[s]
var maxRows = sheet.getMaxRows();
var lastRow = sheet.getLastRow();
if (maxRows-lastRow != 0){
sheet.deleteRows(lastRow+1, maxRows-lastRow);
}
}
}

1 Like

Not for all workbooks, just three sheets (not including headers).
This script will close my glide hehehe… :sweat_smile:

What is the trigger?

no… lol glide does not operate on empty rows… if you delete all empty columns and rows…Glide will sync much faster!.. you can put any trigger you want…
Darren’s code is kind of weird… so maybe this one will work good for you :wink:

In this part, I don’t use the script from Darren and a notification appears that I can’t sync from the spreadsheet. And it keeps adding rows.
I need to explain that I use a checklist with a custom action to fill the column with the word ##DELETE at once. This is what happened.
I also use your script for other sheets, it still works normally. Only in this case, there seems to be something weird.

what actions fill more than one row? multiple check list?

No, Inline checklist.

All have 3 sheets to fill with ##DELETE VALUE

but each sheet, just one ##DELETE VALUE in one row?.. you don’t use ##… more than ones in 1 row?

Yes. Check one then fill in ##DELETE, and so on. Only one per row-column per sheet.

and what exactly is happening when you do that?

Multiplication empty rows