Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
Completely new to VBA in Excel. I've got a large number of excel files (approx 600) all which contain up to 20 hyperlinks to drawings and other files contained on a workgrouped computer. Due to the computer crashing we have had to move all these drawings to another computer and i need to find a way to update what is potentially 12,000 hyperlinks. (i'm aware that the setup of these computers is by no means ideal) Anyway i've tried to copy some vba off the microsoft site with no luck as yet. If anyone can find the error or has a better solution please let me know. Code below: (http://support.microsoft.com/default...b;en-us;247507) Sub HyperLinkChange() Dim oldtext As String Dim newtext As String Dim h As Hyperlink ' These can be any text portion of a hyperlink, such as ".com" or ".org". oldtext = "/Matt" newtext = "/Bob" ' Check all hyperlinks on active sheet. For Each h In ActiveSheet.Hyperlinks x = InStr(1, h.Address, oldtext) If x 0 Then If h.TextToDisplay = h.Address Then h.TextToDisplay = newtext End If h.Address = Application.WorksheetFunction. _ Substitute(h.Address, oldtext, newtext) End If Next End Sub Cheers |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Updating | Excel Worksheet Functions | |||
DDE and updating | Excel Discussion (Misc queries) | |||
Excel Hyperlinks- cell content v. hyperlinks | Excel Discussion (Misc queries) | |||
updating? | Excel Discussion (Misc queries) | |||
When updating a worksheet, how do I create a link updating the sa. | Excel Worksheet Functions |