PDA

View Full Version : Solved: Remove Drive Name In Hyperlink...



Wolfgang
11-14-2006, 10:23 AM
Hi All...

My friend Kurt inherited a workbook with some 50 sheets which have "hard-coded" Hyperlinks on each one of them...

Is there an easy way to delete all characters left of "Kurt", please...

Best,
Wolfgang

An Example-file is attached...

malik641
11-14-2006, 10:49 AM
Hey Wolfgang,

This will reset the hyperlinks to wherever the workbook resides...which I believe is what you want:
Option Explicit
Sub FixHyperlinks()
Dim ws As Worksheet
Dim HLink As Hyperlink

For Each ws In ThisWorkbook.Worksheets
For Each HLink In ws.Hyperlinks
HLink.Address = Right(HLink.Address, Len(HLink.Address) - 3)
Next
Next
End Sub
Hope this helps! :)

Wolfgang
11-14-2006, 10:57 AM
Hi Joseph..

That's exactly it...

I will tell Kurt that this was one of my brilliant ideas...

Don't worry, he's not going to believe me anyway...

Have a nice day in hopefully sunny Florida...Overhere it's simply disgusting...

Thank you very much,
Wolfgang

malik641
11-14-2006, 11:18 AM
No problem Wolfgang, glad to help :thumb

I will tell Kurt that this was one of my brilliant ideas...
:giggle


Have a nice day in hopefully sunny Florida...Overhere it's simply disgusting...It's a little cloudy, but warm..and I like the warm :cloud9:

Sorry to hear the bad weather, hopefully things will brighten up! :yes