0

I want to start with being able to enter in cell A1 a name. Then that name appear into a document.

I would simply like to run a test so far where I end up with

e.range.setNote("Edited by: " + name);

Every time I run that tesI i get back "undefined" or "Range" never a name.

I know I'm bound to sheets and I am guessing I need the trigger to be onEdit or onChange

The data for final project is being added after form data is gathered on same sheet and on same rows. If that has anything to do with it.

Rubén
  • 34,714
  • 9
  • 70
  • 166
  • 1
    Read [how to ask](https://stackoverflow.com/help/how-to-ask) – Cooper Feb 01 '18 at 18:49
  • Possible duplicate of [How can I test a trigger function in GAS?](https://stackoverflow.com/questions/16089041/how-can-i-test-a-trigger-function-in-gas) – Rubén Feb 02 '18 at 15:27

1 Answers1

1

Enter data and get data from a cell.

var sh=SpreadsheetApp.getActiveSheet();
sh.getRange('A1').setValue('Name');
var name=sh.getRange('A1').getValue();
Cooper
  • 59,616
  • 6
  • 23
  • 54
  • Now if I wanted it to automatically go to next cell is there a loop expression i have to write or can that code do it for me – Richard Fullem Feb 02 '18 at 06:06
  • You probably want to use a for loop and then getValues function which will put all of the values in a range into an array and then use the index of the for loop to index values in the array. We generally make the assumption that you already know how to program in Java script. If you don’t, then you should go learn JavaScript. – Cooper Feb 02 '18 at 17:50