Updating Links on Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a spreadsheet that summarizes data from 300+ different workbooks.
Every month a new file is created and we need to update the summary with the
new month data. Is there a better way to update the links on the summarizing
spreadsheet? Currently, we need to edit links and update links for each
(300+) file name. The only thing that changes in the file names is the month.
Thanks!
 
Are you speaking about hyperlinks or a formula that directs the cell to get
data out of another file?
 
You could do a global change for the information you want to change or you
could put the month into a cell and give it a name. Select the cell and then
INSERT -> NAME -> DEFINE and give it an appropriate name.

If in your cells, you have something that looks like this:

Y:\folder1\folder2\MONTH.xls
You could change it to include

"Y:\folder1\folder2\" & MONTH & ".xls"

I hope this helps you.
 
Assuming your monthly data file names end with mm.xls (eg: 06.xls for june),
apply following macro:

HTH
--
AP

'----------------------------------------------
Sub NewMonth()
Dim sMonthId As String
Dim rDept As Range
Dim aLinks As Variant
Dim iLink As Integer
Dim sOldLink As String
Dim snewlink As String

sMonthId = Format(Range("A1").Value, "mm")
aLinks = ActiveWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(aLinks) Then
For iLink = LBound(aLinks) To UBound(aLinks)
sOldLink = aLinks(iLink)
snewlink = Application.Replace( _
sOldLink, _
InStrRev(sOldLink, ".") - 2, _
Len(sMonthId), _
sMonthId)
ActiveWorkbook.ChangeLink _
Name:=sOldLink, _
newname:=snewlink
Next iLink
End If
End Sub
'--------------------------------------------------
"Update Link Question" <Update Link (e-mail address removed)> a
écrit dans le message de (e-mail address removed)...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top