0

I am a newbie to this, so i assume it is a simple mistake. My goal is to copy the data I have written into a sheet in Spreadsheet "test" into a different Spreadsheet called "destination"

This is my code, but it's simply not working.

function onEdit(e) {
   var activeCell = SpreadsheetApp.getActiveSpreadsheet().getRange(e.range.getRow(), e.range.getColumn());
   var destinationCell = SpreadsheetApp.openById('1f4zXuoqTTJIgZmu-fnErxEpBAizhTNZ25kysrhJHUNk').getSheetByName('Sheet1').getRange(activeCell.getRow(),activeCell.getColumn());
   destinationCell.setValue(activeCell.getValue());
   }

Can someone help me?:)

Marios
  • 26,333
  • 8
  • 32
  • 52
Joana W.
  • 11
  • 3

1 Answers1

0

Try this with an installable trigger:

function onMyEdit(e) {
    SpreadsheetApp.openById('ssid').getSheetByName('Sheet1').getRange(e.range.getA1Notation()).setValue(e.value);
}
Cooper
  • 59,616
  • 6
  • 23
  • 54