ARTICLE AD BOX
You need to use template literals:
let newPivotTable = workbook.addPivotTable("PivotTable1", selectedSheet.getRange(`A26:AD${lastRowAD}`), sheet2.getRange("A3"));You probably also need to subtract by one when calculating lastRowAD to get the actual last-row:
let lastRowAD = colADUsed.getRowIndex() + colADUsed.getRowCount() - 1;28.7k4 gold badges31 silver badges56 bronze badges
