+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    05-20-2008
    Posts
    77

    Find data in a closed workbook

    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

  2. #2
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: Find data in a closed workbook

    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

  3. #3
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,142

    Re: Find data in a closed workbook

    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.

  4. #4
    Registered User
    Join Date
    12-15-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Find data in a closed workbook

    Adding to NBVC's comment:

    Example: ='[IT Logs.xls]Requests'!$J$17

    Syntax: ='[Filename]Worksheet'!Range

  5. #5
    Registered User
    Join Date
    05-20-2008
    Posts
    77

    Re: Find data in a closed workbook

    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

  6. #6
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,142

    Re: Find data in a closed workbook

    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.

  7. #7
    Registered User
    Join Date
    05-20-2008
    Posts
    77

    Re: Find data in a closed workbook

    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

  8. #8
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,142

    Re: Find data in a closed workbook

    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.

  9. #9
    Registered User
    Join Date
    05-20-2008
    Posts
    77

    Re: Find data in a closed workbook

    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 -
    Code:
    =VLOOKUP(E6,[Workload.xls]Mids!$A:$N,14,FALSE)
    All it does is check to see if the Site ID is in my region...

    JonesZoid

  10. #10
    Valued Forum Contributor
    Join Date
    02-27-2008
    Posts
    753

    Re: Find data in a closed workbook

    HI
    Save the codes in a workbook inside the folder and run the macro.
    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
    this code lists all files in the folder and pulls J17 & L40 of sheet1 from closed workbook.
    ravi

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0