augment code to remove ALL hyperlinks in the workbook

bradjedis
4StarLounger
Posts: 440
Joined: 30 Mar 2010, 18:49
Location: United States

augment code to remove ALL hyperlinks in the workbook

Post by bradjedis »

Greetings,

I have the following:

Sub RemoveHyperlinks()
ActiveSheet.Hyperlinks.Delete
End Sub

I would like it to cycle through ALL sheets in the workbook and remove all hyperlinks.

Please assist!

User avatar
HansV
Administrator
Posts: 72003
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: augment code to remove ALL hyperlinks in the workbook

Post by HansV »

Like this:

Code: Select all

Sub RemoveAllHyperlinks()
    Dim wsh As Worksheet
    For Each wsh In Worksheets
        wsh.Hyperlinks.Delete
    Next wsh
End Sub
Regards,
Hans

bradjedis
4StarLounger
Posts: 440
Joined: 30 Mar 2010, 18:49
Location: United States

Re: augment code to remove ALL hyperlinks in the workbook

Post by bradjedis »

Sorry for delay in responding. This worked great!