title: Copy data from one cell to another - Google scripts
body: <p>I'm having issues copying data from one cell to another in my google spreadsheet by using a google script. I can get the value of the cell that I desire but I have issues copying it to a different cell. Here is my code.</p>
  
  <pre><code>var sourceSS = SpreadsheetApp.openById(logKey);
  var value = sourceSS.getSheetByName(sourceSheetName).getRange(sourceCell).getValue();
  var logSS = SpreadsheetApp.openById(logKey);
  var sheet = logSS.getSheetByName(logSheetName);
  logSS.getSheetByName(logSheetName).getRange(logCell).setValue(value);
  </code></pre>
  
  <p>I have now changed my code as shown in the image below with the error.
  <a href="https://i.stack.imgur.com/jNGYf.png" rel="nofollow noreferrer">Error</a></p>