Hi all,Would it be possible to find data from 2 cells in multiple closed excel workbooks in a specified folder.
The cells are the same in all the spreadsheets (J17 & L40), but they all have different file names.
JonesZoid
Hi,
To retrieve data from closed files, you need to look into the PULL() function from Harlan Grove, or download the add-in designed by Laurent Longre called morefunc ...
HTH
It might also depend on how you intend to retrieve the data...
If it is a simple formula where you actually name the workbooks directly within the formula, then you can probably do it without the Pull or Indirect.ext functions...
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Adding to NBVC's comment:
Example: ='[IT Logs.xls]Requests'!$J$17
Syntax: ='[Filename]Worksheet'!Range
I currently have a folder where all the workbooks are held. D:/Surveys
This folder holds all of the UK's information on a weekly basis.
So - i need to extract 2 cells of information (Site Name and ID) so i can accertain which workbooks are the ones i require for MY Region via a vlookup. If i can delete workbooks that dont match my vlookup as well, that would be a big bonus.
Hope this clears up - exactly what my requirements are.
JonesZoid
It doesn't really clear up much... but if you are looking to indirectly refer to a workbook by date as a name.. then you will need the functions mentioned by JeanRage.
Can you give an example of what exactly you want to do?
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
OK - Basically, all of the closed workbooks, all with different names hold alot of information - i only require info from 2 cells, say for ease: A1 - Site Name and A2 - Site ID.
In my open workbook - i have a vlookup that checks the Site ID to see if it is in my region. (This only works within this workbook, at the moment)
Can this vlookup be incorporated into the pull or indirect functions to tell me which of the closed workbooks are for my region. This output can be put onto a new sheet if required.
JonesZoid
How many closed books are we talking about...
How is the vlookup setup now and how do you want it set up?
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Hi All - The closed workbooks can range from 20 to 200 or more depending on the work load.
My vlookup currently looks at the Site ID and matches it with the sites in my region - but i only perform this currently on a one to one workbook report. But this report is no longer being used - hence all the workbooks....
This is my current vlookup -All it does is check to see if the Site ID is in my region...Code:=VLOOKUP(E6,[Workload.xls]Mids!$A:$N,14,FALSE)
JonesZoid
HI
Save the codes in a workbook inside the folder and run the macro.
this code lists all files in the folder and pulls J17 & L40 of sheet1 from closed workbook.Code:Sub zonesjoid() Dim e As Long Dim f As String, b As String Application.ScreenUpdating = False Application.DisplayAlerts = False Sheets("Sheet1").Select Cells(1, 1) = "=cell(""filename"")" Cells(1, 2) = "=left(A1,find(""["",A1)-1)" Cells(3, 1).Select f = Dir(Cells(1, 2) & "*.xls") Do While Len(f) > 0 ActiveCell.Formula = f ActiveCell.Offset(1, 0).Select f = Dir() Loop For e = 3 To Range("A65536").End(xlUp).Row If Cells(e, 1) <> ActiveWorkbook.Name Then Cells(1, 3) = "='" & Cells(1, 2) & "[" & Cells(e, 1) & "]Sheet1'!J17" Cells(e, 2) = Cells(1, 3) Cells(1, 3) = "='" & Cells(1, 2) & "[" & Cells(e, 1) & "]Sheet1'!L40" Cells(e, 3) = Cells(1, 3) End If Next e Application.ScreenUpdating = True Application.DisplayAlerts = True MsgBox "collating is complete." End Sub
ravi
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks