In Excel Office Scripts, I need to get a range starting from cell B2 all the way down to the last cell in column 2 that contains data, contiguously.
That is the equivalent, of selecting B2 and clicking Ctrl + Down.
What kind of method does that?
This is my code, and I want to replace .getRange("B2:B4")
by something automatic.
function main(workbook: ExcelScript.Workbook) {
let selectedSheet = workbook.getActiveWorksheet();
// Set font bold to true for range B2:B4 on selectedSheet
selectedSheet.getRange("B2:B4").getFormat().getFont().setBold(true);
}
Please try.
Microsoft documentation: