Last active
December 18, 2018 20:51
-
-
Save phillypb/bf11a3c54b671fe49cf2e1151b61e906 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 setUrlLink(docUrl, name) { | |
// existing document Url - remove this line when you incorporate into your script | |
var docURL = 'https://docs.google.com/document/d/1vo_mGPR_n54PoLDhgXOfYwkHCC3qb9J1JA_icbneMm4/'; | |
// suitable name for text to display in spreadsheet - remove this line when you incorporate into your script | |
var name = 'Finance Spreadsheet'; | |
// get relevant spreadsheet items | |
var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
var numCols = ss.getLastColumn(); | |
var lastRow = ss.getLastRow(); | |
// set 'URL' column with link to newly created doc | |
ss.getRange(lastRow+1, numCols).setFormula('=HYPERLINK("' + docURL + '","' + name + '")'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment