MattArmitt
New Member
- Joined
- Aug 29, 2007
- Messages
- 36
Hi
I am looking for a bit of help with a problem I am having.
I have a central workbook that collates the data from numerous other workbooks onto a master workbook. At the moment this achieved using links. Unfortunately there are a lot of workbooks and so the linking can take time and can be unstable.
What I would like to do is to use VBA to extract the information for me.
The source workbooks will all be kept in the same location. The worksheets on each workbook will be the same on source and master. Below is an extract of the code I have used to reference to the source files:
Dim SiteName As String
Dim FileName As String
Dim FilePath As String
FileName = InputBox("Enter source file name", "FileName")
SiteName = InputBox("Please Enter Site Name", "Site")
FilePath = "s:\Matt\NPO Reports\"
workbooks.open(FilePath & FileName)
In the context of the code I have written this works in that it opens the required file and I can then copy the data over to the master file using additional code.
My problem is that I don't want to keep having to open the source files to extract the data. Is there any way that I could extract data from a workbook without first having to open it?
Thanks
Matt
I am looking for a bit of help with a problem I am having.
I have a central workbook that collates the data from numerous other workbooks onto a master workbook. At the moment this achieved using links. Unfortunately there are a lot of workbooks and so the linking can take time and can be unstable.
What I would like to do is to use VBA to extract the information for me.
The source workbooks will all be kept in the same location. The worksheets on each workbook will be the same on source and master. Below is an extract of the code I have used to reference to the source files:
Dim SiteName As String
Dim FileName As String
Dim FilePath As String
FileName = InputBox("Enter source file name", "FileName")
SiteName = InputBox("Please Enter Site Name", "Site")
FilePath = "s:\Matt\NPO Reports\"
workbooks.open(FilePath & FileName)
In the context of the code I have written this works in that it opens the required file and I can then copy the data over to the master file using additional code.
My problem is that I don't want to keep having to open the source files to extract the data. Is there any way that I could extract data from a workbook without first having to open it?
Thanks
Matt