Answer the question
In order to leave comments, you need to log in
How to write a macro that adds data from another sheet to the end of a range with data?
There is a customer database. Name, Phone, Email, etc.
It is necessary to make a macro that will copy all this data in one sheet and add them to another sheet below all previous data.
How to write this script correctly.
Answer the question
In order to leave comments, you need to log in
1. Get a range with data.
2. On the sheet to which you are copying, check the last completed line.
3. Copy your range.
function copyTo() {
let ss = SpreadsheetApp.getActiveSpreadsheet();
let sheet1 = ss.getSheetByName("Лист1");
let sheet2 = ss.getSheetByName("Лист2");
let data = sheet2.getRange(1, 1, 3, 1).getValues();
sheet1.getRange(sheet2.getLastRow() + 1, 1, 3, 1).setValues(data);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question