Explanation:
The following script will copy the data from the Calculator sheet; ranges B3:B5
, D3:D5
and F3:F5
to the next available row of the RawData sheet when you click a button called Submit
. In your case, I created the button under the Scripts
menu as you can see in the screenshot below. I already implemented the solution for you in the shared document, therefore you just have to try it out.
Solution:
function copyToRawData() {
const ss = SpreadsheetApp.getActive();
const cal_sh = ss.getSheetByName('Calculator');
const raw_sh = ss.getSheetByName('RawData');
const ranges = ['B3:B5','D3:D5','F3:F5'];
const values = [];
ranges.forEach(r=>values.push(...cal_sh.getRange(r).getValues().flat()));
raw_sh.getRange(raw_sh.getLastRow()+1,1,1,values.length).setValues([values]);
}
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Menu')
.addItem('Submit', 'copyToRawData')
.addToUi();
}
Result:
Here is the submit button that you need to press in order to perform this operation.