Was wondering if there is a way to write excel office script to fill down values in excel sheet. Similar to what we achieve using 'go to special' in the legacy excel Or if we can convert below VBA to excel office script.
Sub FillDown()
For each cell in Selection
if cell = "" Then
cell.FillDown
End if
Next
End Sub
Edit
Below is a screenshot of what I want to achieve. Image of dataset
I have so far used below code to get empty cells, now i need to get value above empty cells and iterate each empty cell filling with Value above.
function main(workbook: ExcelScript.Workbook) {
// Get the current used range.
let range = workbook.getActiveWorksheet().getUsedRange();
// Get all the blank cells.
let blankCells = range.getSpecialCells(ExcelScript.SpecialCellType.blanks).getAddress();
console.log(blankCells)
//I want to iterate on each blank cell and take the value above it into this blank celles //
}
Thank you.