Forum Discussion

bcsteeve's avatar
bcsteeve
Copper Contributor
Jan 04, 2024
Solved

Office Scripts in Excel: Can I have a button in worksheet 1 that updates a cell in worksheet 2?

This may be trivial, this may be impossible.  I was only made aware of the existence of Office Scripts yesterday and I really have no idea of their capability.  I was trying to look through some samp...
  • JKPieterse's avatar
    Jan 04, 2024

    Copying a value from one cell to another is quite simple. This copies the value of cell A1 on Sheet1 to cell E1 on Sheet2:

    function main(workbook: ExcelScript.Workbook) {
    
        workbook.getWorksheet("Sheet2").getRange("E1").setValue(workbook.getWorksheet("Sheet1").getRange("A1").getValue());
    
    }

Resources