According to this post Insert row between different data I'm able to insert an empty data row between some rows in a spreadsheet (based on a condition).
I'm trying to make this script adaptable based on the number of columns.
I mean, if I have 3 columns I have to write
newValues.push(['','','']);
If I have 5 columns (i.e.) I have to change in
newValues.push(['','','','','']);
I want to make this change automatic. I've tried with something like
var blankRow = ' " " ';
for (var x = 0; x<lastCol; x++){
blankRow = blankRow + ',""';
}
.....
newValues.push([blankRow]);
when I run the script gives me an error.
Any idea how can I do? Thanks!