Forum Discussion
Jeff_Hunt
Aug 15, 2023Copper Contributor
Need a script to find the last cell-copy, paste as value, then format as text on another sheet.
Here is a greatly simplified version of a script I am trying to run: In this example I have it going to a single column sheet that will work fine. It may work better (I need this for a Pow...
- Aug 16, 2023
Perhaps like
function main(workbook: ExcelScript.Workbook) { const value = workbook .getWorksheet("Sheet1") .getUsedRange() .getLastCell() .getValue() .toString() const targetCell = workbook .getWorksheet("Sheet2") .getUsedRange() .getLastCell() .getOffsetRange(1, 0) targetCell .setNumberFormats([["@"]]) targetCell .setValue(value) }
Jeff_Hunt
Aug 16, 2023Copper Contributor
PERFECT - many thanks!
SergeiBaklan
Aug 16, 2023Diamond Contributor
Jeff_Hunt , you are welcome, glad to help