How to pull data from another workbook automatically?

sburns

New Member
Joined
Nov 9, 2007
Messages
10
I am trying to figure out how to make a workbook pull data from different workbooks in a shared folder under a particular year. The workbooks are saved based on a date name (eg UP08-0107 that is Jan 07, 08) - this would be in the 2008 folder of the shared file.

So, I am trying to make this excel sheet where I can type in different dates, in the format mentioned above, and have excel go to this shared folder, to this years folder, and look for a saved file with that specific date name and pull cell $F$51.

Is this possible?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Welcome to the Board!

Here are references two methods from Debra Dalgliesh's site:

Harlan Grove wrote a UDF called PULL that will retrieve the value from a closed workbook. You can find the function at Harlan's FTP site: ftp://members.aol.com/hrlngrv/ Look for pull.zip
  • Laurent Longre has an addin (morefunc.xll) at: http://xcell05.free.fr/
    It includes =indirect.ext() that may help you.
You can also see: http://www.erlandsendata.no/english/index.php?d=envbawbreadfromclosedwb

Hope that helps,
 
Upvote 0
The links didn't really help, two of them didn't work and the third was a little confusing. I should probably explain a bit more... this question is probably out of my skill set. But it would be huge if I could do this as I have just started a new job and this was asked of me do try and do.

This is an example of the drive I want to pull from:
='S:\Workgroups\ICAP United OTC sheets\2008\[up08-0107.xls]UPI'!F51

1. I wanted the 2008 to be a variable.
2. I wanted the spreadsheet name to correlate with a date I enter. So, if I wanted July 2,2008; I would put that date in a cell and it would pull up08-0702.xls (using 08 from the 2008 cell mentioned above in #1.
3. I also wanted to have the cell reference as a variable.

I know this can be done and I want to learn how to do it. But I need a good teacher.

Thanks everyone.
 
Upvote 0
Hello All,

I am basically trying to do the exact same thing that sburns was. I have tried to a function I found on a website someone wrote. It was called GetValue.

The GetValue Function<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
The GetValue function, listed below takes four arguments:<o:p></o:p>
· path: The drive and path to the closed file (e.g., "d:\files")<o:p></o:p>
· file: The workbook name (e.g., "budget.xls")<o:p></o:p>
· sheet: The worksheet name (e.g., "Sheet1")<o:p></o:p>
· ref: The cell reference (e.g., "C4")<o:p></o:p>
Private Function GetValue(path, file, sheet, ref)<o:p></o:p>
' Retrieves a value from a closed workbook<o:p></o:p>
Dim arg As String<o:p></o:p>
' Make sure the file exists<o:p></o:p>
If Right(path, 1) <> "\" Then path = path & "\"<o:p></o:p>
If Dir(path & file) = "" Then<o:p></o:p>
GetValue = "File Not Found"<o:p></o:p>
Exit Function<o:p></o:p>
End If<o:p></o:p>
' Create the argument<o:p></o:p>
arg = "'" & path & "[" & file & "]" & sheet & "'!" & _<o:p></o:p>
Range(ref).Range("A1").Address(, , xlR1C1)<o:p></o:p>
' Execute an XLM macro<o:p></o:p>
GetValue = ExecuteExcel4Macro(arg)<o:p></o:p>
End Function<o:p></o:p>
This function is not working for me for what every reason it always outputes file not found in the cell which i try to deploy it in. I tried the links in this thead and they both are to sites that are no longer availible. Would anybody be able to lend me some advice on this issue.

Thanks in advance.
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,427
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top