In Excel Office Scripts, I'm trying to find a way to dynamically select a range starting from cell B2 all the way down to the last cell in column 2 that contains data without any gaps.
Basically, I want to achieve the same result as manually selecting B2 and pressing Ctrl + Down in Excel.
Does anyone know of a method that can accomplish this task?
Here is the code I'm currently using, and I'm looking to replace .getRange("B2:B4")
with an automated solution.
function main(workbook: ExcelScript.Workbook) {
let selectedSheet = workbook.getActiveWorksheet();
// Set font bold to true for dynamically selected range starting from B2 on selectedSheet
// Need help with this part
}