Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

Linking excel data between multiple excel files

$
0
0

So I have multiple excel files, lets call these Master, Data1, Data2, Data3... Now Master contains sheets that correspond to the Data files, so sheets named Data1, Data2 etc. What I need to do is somehow link the cells from the Data files to the Master file so that if the data changes in one, it automatically updates the other. I've done some experimenting with excel links but the problem I ran into is that when I tried to edit the linked cell, instead of the data it showed me the link path to the file its linking to, instead of the data from the other file. I will do more research on my own but any insight will be extremely helpful and appreciated. Thanks!

Update:

I found this useful little script:

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rFrom as Range
    If Target.Count = 1 Then
        With Target.WorkSheet
             Set rFrom = .Range("A1:A20")
             If Not Intersect(Target, rFrom) Is Nothing Then
                 Application.EnableEvents = False
                 'Include next line Just in Case something happens
                 '    You don't want to leave EnableEvents off
                 On Error Resume Next
                 rFrom.Copy Worksheets("Sheet2").Range("B10:B30")
                 If Err.Number <> 0 Then
                     Msgbox "Error Occurred"
                 End If
                 Application.EnableEvents = True
             End If
         End With
    End If
End Sub
Except I need to copy from another Workbook, not just worksheet, I tried simply adding Workbook("File.xlsx").Worksheets etc but that didnt work

Viewing all articles
Browse latest Browse all 11829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>