Answer the question
In order to leave comments, you need to log in
We need a macro that, when executed, will copy the string and paste its values below into a free string. How to do it?
There is a line with a dynamic date (2:2), on which, in fact, all the data in it depends. It is necessary to keep a history of changing the values in this line by creating a log in the form of a list. To do this, when executing the macro, copy the line and paste its values below into a free line, so that a table is created in this way.
The figure shows how it should look like:
1. a string whose values need to be copied;
2. lines that have already been copied before by this method;
3. the first free line where the values will be copied after the macro is executed.
I tried to find a formula that could implement this, but I couldn’t, I came to the conclusion that only macros would help in solving my problem, but I’m not strong at writing macros at all, I would be grateful for help or a kick in the right direction.
UPDATE:
I found a solution to my question - a script in Google spreadsheets:
function copytestdata() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
varsheet1 = ss.getSheetByName("original");
var sheet2 = ss.getSheetByName("copy");
sheet1.getRange("A2:H1").copyTo(sheet2.getRange(sheet2.getLastRow()+1,1,1,7), {contentsOnly:true});
}
original and copy - sheet names, replace them with your own, in my case they are the same
A2:H1 - replace with your range,
Answer the question
In order to leave comments, you need to log in
I found a solution to my question - a script in Google spreadsheets:
function copytestdata() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
varsheet1 = ss.getSheetByName("original");
var sheet2 = ss.getSheetByName("copy");
sheet1.getRange("A2:H1").copyTo(sheet2.getRange(sheet2.getLastRow()+1,1,1,7), {contentsOnly:true});
}
original and copy - sheet names, replace with your own in my case they are the same
A2:H1 - replace with your range that will be copied
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question