Forum Discussion

Kim Christopher's avatar
Kim Christopher
Copper Contributor
Jun 19, 2018
Solved

Editing hyperlinks in bulk

I have a speadsheet that has the emails but only as hyperlinks. I just want to make this a plain text doc with the email addresses and don't want to have to click and edit each record individually. Tried a macro to no avail. Thanks

  • Hi Kim,

     

    Please try this code.

    Sub GetHyperlinksAddresses()

    'Written By Haytham Amairah

        Dim hy As Hyperlink
        
        For Each hy In ActiveSheet.Hyperlinks
            hy.Range.Value = hy.Address
            hy.Delete
        Next hy

    End Sub

     

    Regards

7 Replies

  • Haytham Amairah's avatar
    Haytham Amairah
    Silver Contributor

    Hi Kim,

     

    Please try this code.

    Sub GetHyperlinksAddresses()

    'Written By Haytham Amairah

        Dim hy As Hyperlink
        
        For Each hy In ActiveSheet.Hyperlinks
            hy.Range.Value = hy.Address
            hy.Delete
        Next hy

    End Sub

     

    Regards

  • Kim Christopher's avatar
    Kim Christopher
    Copper Contributor
    Yes - that just returns the "text to display" which is "Email Me" and not the address. Thanks tho.
  • Damien_Rosario's avatar
    Damien_Rosario
    Silver Contributor

    Hi Kim

     

    Have you tried saving the Excel doc as a CSV or txt file (File > Save As)?

     

    In either option, it will give you the addresses as plain text without the hyperlinks.

     

    Cheers

    Damien

Resources