Created
June 5, 2021 11:44
-
-
Save kikoso/35f1d2871b5659682f641e58730cb0b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function copyPortfolioValue() { | |
var rangeToLog = 'Investment!B71:F71';// this is where the data tocopy is located | |
var sheetToLogTo = 'Value';// this is the name of new sheet we want to copy to | |
var ss = SpreadsheetApp.getActive();// getting th spreadsheetvar | |
valuesToLog = ss.getRange(rangeToLog).getValues();// getting the desired data | |
var logSheet = ss.getSheetByName(sheetToLogTo);// getting the sheet to copy | |
if (!logSheet) {// just in case you didn’t createit | |
logSheet = ss.insertSheet(sheetToLogTo); | |
} | |
var rowToAppend = valuesToLog.reduce(function (a, b) { return a.concat(b); })// format data | |
logSheet.appendRow(rowToAppend);// copy the desired data to the new sheet | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment