Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function onEdit(e) {
var sheet = SpreadsheetApp.getActive().getActiveSheet();
//Get the final potential rows
var row = 10;
var varA = SpreadsheetApp.getActiveSheet().getRange(row, 4).getValue();
var varB = SpreadsheetApp.getActiveSheet().getRange(row, 5).getValue();
var varC = SpreadsheetApp.getActiveSheet().getRange(row, 6).getValue();
var varD = SpreadsheetApp.getActiveSheet().getRange(row, 7).getValue();
var varE = SpreadsheetApp.getActiveSheet().getRange(row, 8).getValue();
//resizing rows
var startRow = 12;
var endRow = 13;
var numCols = 8;
var numRows = endRow - startRow + 1; //Needs to be inclusive [x,y] not [x,y)
var rowRanges = sheet.getRange(startRow, numCols, numRows)
if (varA == "" || varB == ""
|| varC == ""|| varD == ""
|| varE == "") {
//hide the rows since they have nothing in them
sheet.hideRow(rowRanges)
} else {
sheet.unhideRow(rowRanges)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.