简体   繁体   中英

After using importRange to get Hyperlinked cells, how do you get the value of the URL?

I was trying to help someone solve a problem the other day and I came across an interesting issue I couldn't solve.

Imagine two sheets. One containing HYPERLINKS created by HYPERLINK function in Google Sheets, such as this sheet. Source Sheet

Then you have another sheet that uses importRange to import these URL's, like this sheet. import Sheet

The URLs import correctly, with correct link and link text. But no matter what I tried, in the import sheet, I couldn't extract the link value.

I tried to do this via formulas and via scripting. I'm guessing the URL must be some sort of object but I cannot seem to read or split it. Whatever efforts I've tried have always returned the link text, EG Google, Yahoo and not the URL itself.

There is no way to getting the hyperlink value from the cell. getValues, getDisplayValues, even getDataSourceUrl do not return the hyperlink value, only the display value as a string. And because this is from an IMPORTRANGE getFormulas will only return an empty array.

If you want you can put in a feature request at: https://code.google.com/p/google-apps-script-issues/issues/list

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM