• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Removing Hyperlink

chandrashekarb

New Member
Hi,


I am looking for a VBA code which removes object releated hyperlinks. I have nearly 200 objects in the worksheet.


Thanks in Advance.


Regards,


Chandrashekar B
 
Copy the following code into a code module in VBA

Execute it, F5


It will delete all Hyperlinks which are in Shapes, Pictures, Charts

But not in Cells or on the worksheet

[pre]
Code:
Sub Del_Shape_Hyperlinks()
Dim h As Hyperlink
Dim wsheet As String

wsheet = ActiveSheet.Name

For Each h In Worksheets(wsheet).Hyperlinks
If h.Type = 1 Then h.Delete 'Change to =0 to delete all Cell/Range Hyperlinks
Next
End Sub
[/pre]
 
Not much to say about Hyperlinks.Type property

It is 0 for Hyperlinks in cells

It is 1 for Hyperlinks in other objects (Shapes, Pics and Charts)

I Don't believe there are any other assigned values relevant to Excel

http://office.microsoft.com/en-gb/excel-help/HV080559500.aspx
 
Back
Top