6 replies
by lo
Hi
At the point you want data from another workbook, enter =[]!
where:
is the workbook name, in your case B, C or D. If the file is not in the same directory as your default, you will get a popup window that will let you locate. If there are multiple sheets you will get a sheet select window.
is the name of the sheet
is the cell reference
To get A5 of Workbook B in Cell A1 of Workbook A, enter "=[B]Sheet1!A5" (without the ").
You can also do formulas, such as =SUM([B]Sheet5!g5:g15)
Doing this will 'copy' the data, except that if the source (data in Workbook B, C, D changes, the change will be reflected in Workbook A when opened.
Hope that helps, lo
by tclere
In workbook A, add a module and include this subroutine:
This will run when the workbook is opened, assuming that the user "Enables Macros".
Sub Auto_Open()
Dim wbA As Workbook, wsA As Worksheet
Dim wbB As Workbook, wsB As Worksheet
'Workbook A
Set wbA = ThisWorkbook
Set wsA = wbA.Sheets("Sheet1")
'Workbook B
Set wbB = Workbooks.Open(FileName:="C:\BookB.xls")
Set wsB = Sheets("Sheet1")
wsB.Range("A1").FormulaR1C1 = wsA.Range("A1").Text
wbB.Save
wbB.Close
End Sub
This should be enough to get you headed in the right direction. Hope it helps!
This discussion is closed to new replies.
Trending Software posts
Sort by Trending