augment code to remove ALL hyperlinks in the workbook

bradjedis
4StarLounger
Posts: 536
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: 78236
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
Best wishes,
Hans

bradjedis
4StarLounger
Posts: 536
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!