Edit cell’s value

Here is how to edit cell’s value


Source code

function setValue(){
  var val = "Confident is very important";
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sh = ss.getActiveSheet();
  var vlOld = sh.getRange("$A$1").getValue();

  sh.getRange("$A$1").setValue("MINI DEVELOPER WORLD!!");  

  var vlNew = sh.getRange("$A$1").getValue();
  Browser.msgBox("A1 value: Old=" + vlOld + " / New=" + vlNew);






string … a value to be set


How to get range object

Please refer the following posts;

Get active range or active cell object

Get range or cell object by row and column number

Get range or cell object by address


How to get cell’s value

Please refer the following post;

Get cell’s value

Leave a Comment