Skip to content

Instantly share code, notes, and snippets.

View cachho's full-sized avatar

cachho

  • Germany
  • 22:54 (UTC +02:00)
View GitHub Profile
@cachho
cachho / linkURL.gs
Created May 3, 2024 20:38
GoogleSheet : export links and texts separately from a rich text
/**
* 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);