I have a sheet where hyperlink is set in cell, but not through formula. When clicked on the cell, in "fx" bar it only shows the value.
I searched on web but everywhere, the info is to extract hyperlink by using getFormula()
.
But in my case there is no formula set at all.
I can see hyperlink as you can see in image, but it's not there in "formula/fx" bar.
How to get hyperlink of that cell using Apps Script or any formula?
Just type =””& and then the cell (no parenthesis) that you want to retrieve the link text from. Then hit Enter.
You do the proper thing - work on an array of the Range's values - as opposed to repeatedly call over the interface via getCell or similar just to check the value. To reference the cell whose value is values[r][c] , note that the Javascript array is 0-base and the Range is 1-base indexed. So A1 = [0][0].
Right click in your spreadsheet and select the Insert link option. Use the Ctrl + K keyboard shortcut (Cmd + K on a Mac). In the “Text” field that appears, type or edit the text you'd like displayed in the cell containing the link.
When a cell has only one URL, you can retrieve the URL from the cell using the following simple script.
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1");
var url = sheet.getRange("A2").getRichTextValue().getLinkUrl(); //removed empty parentheses after getRange in line 2
Source: https://gist.github.com/tanaikech/d39b4b5ccc5a1d50f5b8b75febd807a6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With