Extracting a URL from hyperlinked text in Excel cell

前端 未结 8 2227
孤街浪徒
孤街浪徒 2020-12-17 23:43

I have a table full of Hyperlinked text in excel, so it\'s basically a bunch of names but when I click on one, it takes me to some URL in my default browser.

So I am

8条回答
  •  囚心锁ツ
    2020-12-17 23:57

    VBA function:

    1. Hit Alt+F11 (Opens Visual Basic Editor)
    2. Click on Insert -> Module (adds a module to your excel file)
    3. Paste the code below for the function of GETURL
    4. Hit Alt+Q (Closes the Visual Basic Editor)

    Now use the =GETURL(cell) to get the URL
    Example: =GETURL(A1) will return the URL for the Hyperlink displayed in cell A1

    Function GETURL(HyperlinkCell As Range)
        GETURL = HyperlinkCell.Hyperlinks(1).Address
    End Function
    

    Source

提交回复
热议问题