remove hyperlinks in a worksheet all in the same time

K

Kent

Dear all,

I have got some hyperlinks in my excel worksheet which may be removed and
replaced by characters one by one. HOw can these hyperlinks be removed all
in the same time?


Thanks you
 
G

Gary''s Student

Try this little macro:

Sub HyperBeGone()
For Each r In ActiveSheet.UsedRange
If r.Hyperlinks.Count > 0 Then
r.Clear
End If
Next
End Sub
 
K

Kent

Thank you Gary, what I need is only to remove the hyperlink, but not delete
the content. Any new idea please?


Kent
 
D

Dave Peterson

select your range to clean
alt-f11 (to see the VBE)
ctrl-g (to see the immediate window)

type this and hit enter
selection.hyperlinks.delete

And then close this window and go back to excel.
 
D

Dave Peterson

I don't think I'd use r.clear.

That'll clean up way more than just the hyperlink.
 
K

Kent

Dear Dave,

I can't follow your instruction starting from "ctrl-g (to see the immediate
window)"
and where should I type "selection.hyperlinks.delete"?
 
D

Dave Peterson

Use alt-f11 to open the VBE.
Hit control-g to see the immediate window
(Or use View|Immediate Window)

type or paste that "selection.hyperlinks.delete" into that immediate window.
 
K

Kent

Thank you Dave, I've done it.




Dave Peterson said:
Use alt-f11 to open the VBE.
Hit control-g to see the immediate window
(Or use View|Immediate Window)

type or paste that "selection.hyperlinks.delete" into that immediate
window.
 

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

Top