Forum Discussion
MadPrince
Oct 05, 2023Copper Contributor
Excel Script, input data in blank column/ rows
I have this problem in my excel script formula. It is working fine. The only problem is that I need to input starting row... And if for example there is data or the column/row is not empty, it will...
MadPrince
Oct 06, 2023Copper Contributor
This did the trick.. thank you.
SergeiBaklan
Oct 07, 2023Diamond Contributor
Or
function main(workbook: ExcelScript.Workbook) {
const arrayvar = workbook
.getTable("Table1")
.getRangeBetweenHeaderAndTotal()
.getValues()
const sheet = workbook.getActiveWorksheet()
let rangeToFill: ExcelScript.Range = sheet
.getCell(
sheet
.getUsedRange()
.getLastRow()
.getRowIndex(), 0)
.getResizedRange(0, arrayvar[0].length - 1)
arrayvar.map(x => {
rangeToFill = rangeToFill.getRowsBelow(1);
rangeToFill.setValues(Array.of(x))
} )
}