|
|
|
date: Mon, 23 Jun 2008 03:28:00 -0700,
group: microsoft.public.excel.links
back
Re: Mass edit Hyperlinks
I created a VBA routine with this, Bill, and then assigned it to a button.
It is not working for me. the routine runs correctly, but the hyperlinks
aren't updating. The files are on our business network, so I am wondering
if that has anything to do with it??
"Bill Manville" wrote in message
news:VA.000014ad.054951e3@msn.com...
> Try this:
>
> Sub ReplaceHyperlinksInActiveWorkbook()
> Dim oSheet As Object
> Dim H As Hyperlink
> Dim stFind As String
> Dim stReplace As String
> stFind = InputBox("What is the initial path to replace?", , "\\Old\")
> If stFind = "" Then Exit Sub
> stReplace = InputBox("What should the path become?", , "\\New\")
> If stReplace = "" Then Exit Sub
> For Each oSheet In ActiveWorkbook.Sheets
> For Each H In oSheet.Hyperlinks
> If InStr(H.Address, stFind) = 1 Then
> H.Address = stReplace & Mid(H.Address, Len(stFind) + 1)
> End If
> Next
> Next
> End Sub
>
>
> Bill Manville
> MVP - Microsoft Excel, Oxford, England
> No email replies please - respond to newsgroup
>
date: Thu, 21 Aug 2008 14:44:13 -0400
author: TR Young
Re: Mass edit Hyperlinks
Where do I learn this secret language? (Dim, etc)?
"Bill Manville" wrote:
> Try this:
>
> Sub ReplaceHyperlinksInActiveWorkbook()
> Dim oSheet As Object
> Dim H As Hyperlink
> Dim stFind As String
> Dim stReplace As String
> stFind = InputBox("What is the initial path to replace?", , "\\Old\")
> If stFind = "" Then Exit Sub
> stReplace = InputBox("What should the path become?", , "\\New\")
> If stReplace = "" Then Exit Sub
> For Each oSheet In ActiveWorkbook.Sheets
> For Each H In oSheet.Hyperlinks
> If InStr(H.Address, stFind) = 1 Then
> H.Address = stReplace & Mid(H.Address, Len(stFind) + 1)
> End If
> Next
> Next
> End Sub
>
>
> Bill Manville
> MVP - Microsoft Excel, Oxford, England
> No email replies please - respond to newsgroup
>
>
date: Fri, 3 Oct 2008 14:20:01 -0700
author: rebecca sage
|
|