This file contains 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
/** | |
* Returns the URL of a hyperlinked cell, if it's entered with hyperlink command. | |
* Supports ranges | |
* @param {A1} reference Cell reference | |
* @customfunction | |
*/ | |
function linkURL(reference) { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var formula = SpreadsheetApp.getActiveRange().getFormula(); | |
var args = formula.match(/=\w+\((.*)\)/i); |