Deactivate all the hyperlinks in an entire workbook?

  • Thread starter Thread starter SouthAfricanStan
  • Start date Start date
Think this might work

Sub DelAllHyperlinks()

Dim WS_Count As Integer
Dim I As Integer

WS_Count = ActiveWorkbook.Worksheets.Count

For I = 1 To WS_Count

Sheets(I).Hyperlinks.Delete
Next I

End Sub

VBA Nob
 
Sub Delete_Hyperlinks()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).UsedRange.Cells.Hyperlinks.Delete
Next n
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP
 
Thanks so far.
I'm a newby as far as this part of excel is concerned.
Please advise me (key by key) how to do this, or perhaps there are relevant
tutorials available on the internet?
 
If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to Tool>Macro>Macros.

You can also assign this macro to a button or a shortcut key combo.


Gord Dibben MS Excel MVP


Thanks so far.
I'm a newby as far as this part of excel is concerned.
Please advise me (key by key) how to do this, or perhaps there are relevant
tutorials available on the internet?

Gord Dibben MS Excel MVP
 
Thank You!

Gord Dibben said:
If not familiar with VBA and macros, see David McRitchie's site for more
on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to Tool>Macro>Macros.

You can also assign this macro to a button or a shortcut key combo.


Gord Dibben MS Excel MVP




Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top