The goal is to delete empty cells in Column N alone, without disturbing the other columns and shift the rest of the cells upwards to obtain a compact column with just non empty cells. There can and will be empty cells after the result of course. Please suggest a method
function Defaulters() {
var spreadsheet = SpreadsheetApp.getActive();
var as = spreadsheet.getActiveSheet();
//to get the last row of the Column
var lastRow = 100;
var range = as.getRange("N" + lastRow);
if (range.getValue() !== "")
{Logger.log(lastRow);}
{lastRow = range.getNextDataCell(SpreadsheetApp.Direction.UP).getRow();}
Logger.log(lastRow);
//to delete the empty cells and give a compact output of just names and emails in the Column
for (var l=lastRow; l>=3; l--)
{if(as.getRange(l,14).getValue() == "")
Logger.log(true); **//what to put here to delete this cell?**
else
Logger.log(false);**// what to put here to retain this cell?**
}
}
function clean_column(col). Adn call this function to clean any column:clean_column('A'),clean_column('B'), etc. See my updated answer.