troubleshooting Question

Change hyperlink addresses that contain a certain substring using VBA

Avatar of Andreas Hermle
Andreas HermleFlag for Germany asked on
VBAMicrosoft ExcelMicrosoft Office
9 Comments1 Solution128 ViewsLast Modified:
Dear Experts:

I got hundreds of hyperlinks on the active worksheet. All of the hyperlink addresses point to network paths.
Lots of them now have to be changed the following way:

Examples and Requirements:

Before

C:\test\MyProduct_90-234-56-17_new_bw.pdf  
C:\test\MyProduct_90-433-22-19_old_bw.pdf
C:\test\MyProduct_90-373-44-18_old_updated_bw.pdf
C:\test\MyProduct_90-244-19-22_bw.pdf
C:\test\MyProduct_90-243-44-11_old_bw.pdf
C:\test\MyProduct_90-433-22-99_bw.pdf
etc.

Only hyperlinks which contain the following substrings are to be worked on: 90-433-22-19, 90-244-19-22, 90-433-22-99
In the above three cases the substring 'bw' at the very end has to be changed to '4c'

In the above example this results in:

After:

C:\test\MyProduct_90-234-56-17_new_bw.pdf  
C:\test\MyProduct_90-433-22-19_old_4c.pdf
C:\test\MyProduct_90-373-44-18_old_updated_bw.pdf
C:\test\MyProduct_90-244-19-22_4c.pdf
C:\test\MyProduct_90-243-44-11_old_bw.pdf
C:\test\MyProduct_90-433-22-99_4c.pdf

All the others have to be left untouched since they do not contain these substrings.

Would be great if somebody could come up with a VBA-solution since I have to change hundreds of these hyperlink addresses. This would save me hours of time.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
ASKER CERTIFIED SOLUTION
GrahamSkan
Retired

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2012

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros