function main(workbook: ExcelScript.Workbook) { let sh=workbook.getWorksheet("Sheet2"); let gapstable = workbook.getTable("gapstable"); let tbl = workbook.getTable("gaps2"); let gapsrange=gapstable.getRangeBetweenHeaderAndTotal(); let gaps: string [] = gapsrange.getValues() as string[]; let jsoninput: string = JSON.stringify(gaps); let jsonoutput: string[] =JSON.parse(jsoninput); let rowcount = jsonoutput.length-1; let colcount = jsonoutput[0].length -1; //let tblrangetodelete let rang = sh.getRange("B14").getResizedRange(rowcount,colcount); rang.setValues(jsonoutput); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter