简体   繁体   中英

Populating a master sheet google sheets

  • I am struggling? Is there a way to fill out information on a Template and then push a button to send the data to a row on the "Master" sheet?, Without adding a new sheet on the bottom each time it gets populated, the data on the template doesn't need to be as detailed in the master

On Google sheets

I'm new to this, I know I need to write a code but I can't find one and don't have the time to study coding before the deadline needs completing.

Simple form with answers in rows in Master List

function saveFormData() {
  const ss = SpreadsheetApp.getActive();
  const sh = ss.getSheetByName("Form");
  const msh = ss.getSheetByName("Master");
  const rgl = sh.getRangeList(["B1","B2","B3","B4","B5","B6"]);
  const r = rgl.getRanges().map(r => r.getValue());
  msh.getRange(msh.getLastRow() + 1,1,1,r.length).setValues([r]);
}

Form:

A B
1 Question1 Answer1
2 Question2 Answer2
3 Question3 Answer3
4 Question4 Answer4
5 Question5 Answer5
6 Question6 Answer6

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM