Skip to content

Instantly share code, notes, and snippets.

@franklinokech
Created March 13, 2019 13:55
Show Gist options
  • Save franklinokech/af9ef9f2cea2366c9a0c130d334feaf9 to your computer and use it in GitHub Desktop.
Save franklinokech/af9ef9f2cea2366c9a0c130d334feaf9 to your computer and use it in GitHub Desktop.
A google app script to CLEAR values in a row NB: Dont delete the row
function deleteRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var values = sheet.getDataRange().getValues();
values.forEach(function(v, i) {
// get row index
var row = i+1;
// look for required values in cells
if (v[14] == '' && v[6] == 'PREBOOKED') {
// might have to modify this line based on Sheets API
sheet.getRange('D'+row+':P'+row).clearContent();
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment