I have a dynamic Google spreadsheet to which I add one more sheet every day. I want to take the data from sheet1 cell D96 (a protect cell) to sheet2 cell D3 (a protect cell) every day. I found a script and I edited it to:

function devir() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var sheetidx = sheet.getIndex()-1 ;
  var nextSheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[sheetidx+1];
  var val = nextSheet.getRange('d96').copyTo(sheet.getRange('d3'),{contentsOnly:true})

and it is working perfectly with a edit trigger for me (owner) but my problem is that the people with whom I am sharing this document (can edit) get this error:

"There was a problem while You don't have permission for this action"

How can I solve this problem or can I change the script to a custom function? like: write d3 cell =devir(d96) take the data before sheet.

pull the date one page to next page

  • does anyone have any answers?
    – user66322
    May 5, 2014 at 12:29
  • well can i pull data from one sheet to another sheet every day automatically? (has not a locked cell). because this code give an error "TypeError: Cannot call method "getRange" of undefined. (line 8, file "Code")" and than number format change into word format and i cant sum.
    – user66322
    May 25, 2014 at 15:30
  • Perhaps you can look at the answer I gave to your other question? May 27, 2014 at 20:54

1 Answer 1


Instead of using an simple on edit trigger use an installable trigger as it runs with the trigger creator credentials.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.