LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Change all Links

Hi,
using a loop, something like:
Dim OldLink, NewLink As String
Dim wsInput As Worksheet
Dim i as long

Set wsInput = ThisWorkbook.Worksheets("Input")
for i =11 to 47
OldLinks = wsInput.Range("E" & i).Value
NewLink = wsInput.Range("C" & i).Value
ThisWorkbook.ChangeLink Name:=OldLink, NewName:=NewLink,
Type:=xlExcelLinks
Next i
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"shorticake" wrote:

Each month I have to change the links in my workbook. I've listed the paths
of the current links in cells E11:E47, and what I want the paths of the new
links to be in cells C11:C47. How can I change the code below so that it will
change all the links in the correct order for example, E11 to C11, E12 to
C12, and so on?

Thanks in advance!

Sub ChangeLink()

Dim OldLink, NewLink As String
Dim wsInput As Worksheet
Set wsInput = ThisWorkbook.Worksheets("Input")

OldLinks = wsInput.Range("E15").Value
NewLink = wsInput.Range("C15").Value
ThisWorkbook.ChangeLink Name:=OldLink, NewName:=NewLink, Type:=xlExcelLinks

End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change multiple links at once TaralearningExcel Excel Worksheet Functions 1 April 8th 10 05:32 PM
Change links between 2 spreadsheets Russell-stanely Excel Discussion (Misc queries) 0 September 20th 06 05:46 PM
change links clixo Excel Programming 0 September 14th 04 04:48 PM
change links by a macro JohnQ[_2_] Excel Programming 2 September 8th 04 12:27 PM
Worksheet Change event and Links? emge[_2_] Excel Programming 4 November 1st 03 09:01 PM


All times are GMT +1. The time now is 12:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"