// Define some app variables
var blkSrcRange = 'A2:C6';
var grySrcRange = 'E1:G6';
var whSrcRange = 'I1:I11';
var tnkClean1StartRange = 'A4';
var srcContents = '';
// Populate report page
var tnk1 = svcRvw.getRange('B9').getValue();
var tnk2 = svcRvw.getRange('B10').getValue();
var tnk3 = svcRvw.getRange('B11').getValue();
var tnk4 = svcRvw.getRange('B12').getValue();
var tnk5 = svcRvw.getRange('B13').getValue();
var tnk6 = svcRvw.getRange('B14').getValue();
Logger.log(tnk6) ; // at this point - Logger shows tnk6 = 'No'
if (tnk1 = 'Yes') {
srcContents = tnkMaster.getRange(blkSrcRange);
tnkClean1StartRange = tnkRvwRpt.getRange(tnkClean1StartRange);
srcContents.copyTo(tnkClean1StartRange);
// Get the last row with content in the specified column
var lastRow = tnkRvwRpt.getLastRow();
var tnkClean1StartRange = ('A' + (lastRow+2));
}else if (tnk2 = 'Yes'){
srcContents = tnkMaster.getRange(blkSrcRange);
tnkClean1StartRange = tnkRvwRpt.getRange(tnkClean1StartRange);
srcContents.copyTo(tnkClean1StartRange);
var lastRow = tnkRvwRpt.getLastRow();
var tnkClean1StartRange = ('A' + (lastRow+2));
}
if (tnk3 = 'Yes'){
srcContents = tnkMaster.getRange(grySrcRange);
tnkClean1StartRange = tnkRvwRpt.getRange(tnkClean1StartRange);
srcContents.copyTo(tnkClean1StartRange);
// Get the last row with content in the specified column
var lastRow = tnkRvwRpt.getLastRow();
var tnkClean1StartRange = ('A' + (lastRow+2));
}else if (tnk4 = 'Yes'){
srcContents = tnkMaster.getRange(grySrcRange);
tnkClean1StartRange = tnkRvwRpt.getRange(tnkClean1StartRange);
srcContents.copyTo(tnkClean1StartRange);
var lastRow = tnkRvwRpt.getLastRow();
var tnkClean1StartRange = ('A' + (lastRow+2));
}else if (tnk5 = 'Yes'){
srcContents = tnkMaster.getRange(grySrcRange);
tnkClean1StartRange = tnkRvwRpt.getRange(tnkClean1StartRange);
srcContents.copyTo(tnkClean1StartRange);
var lastRow = tnkRvwRpt.getLastRow();
var tnkClean1StartRange = ('A' + (lastRow+2));
}
if (tnk6 = 'Yes') { //I have a breakpoint here - the debug panel shows
// the var tnk6 = 'No'
// considering the comparison - this next section should be bypassed
// it is not - in fact using the debug 'step into' link - the next line (below)
// is highlighted and the debug panel shows tnk6 = 'Yes'
srcContents = tnkMaster.getRange(whSrcRange);
tnkClean1StartRange = tnkRvwRpt.getRange(tnkClean1StartRange);
srcContents.copyTo(tnkClean1StartRange);
var lastRow = tnkRvwRpt.getLastRow();
var tnkClean1StartRange = ('A' + (lastRow+2));
}