I am new to this so bear with me. I currently have a google sheet that has formulas in different cells. I want to be able to hide the empty cells if they are blank. Is there a way I can do that? For example, I want to be able to delete all empty cells between B11 and B20.
This is something I have found online but it is not quite doing what I want it to do:
function adder() {
var sheet = SpreadsheetApp.getActive().getSheetByName('NY Quote');
var lastRow = sheet.getLastRow();
for (var i = 1; i < lastRow+1; i++) {
//var valueB = sheet.getRange('B'+(lastRow-i+1)).getValue() + "";
if((sheet.getRange('B'+(lastRow-i+1)).getValue())=="") {
sheet.getRange('B'+(lastRowi+1)).deleteCells(SpreadsheetApp.Dimension.ROWS);
}
}
}
P.S. will the script work if the cells are merged?
Thank you!