Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cross reference FileSearch table with current excel file

Status
Not open for further replies.

jhogie

Technical User
Jun 3, 2008
24
CA
I have already found the specific files that I need through a bunch of 'If' and 'For' statements meanwhile inside a 'With' statement.
- I now want to open up each file and then cross reference ColumnA with columnB in each worksheet in my current excel file.
- And then list all rows from the lookup files that do not show up in my current excel file. I think I need to do all this within the area where ".open.foundfiles(i)" is located.

Note: The purpose of 'LineCode(j)' (string array) is so that I only grab files with specific codes in their names.


Code:
With Application.FileSearch
    .LookIn = Path
    For j = 0 To 13
        .Filename = "??" & LineCode(j) & "??.xls"
        If .Execute() > 0 Then
            MsgBox (.FoundFiles.Count)
            For i = 1 To .FoundFiles.Count
            

            .Open.FoundFiles (i)
            
            
            Next i
        End If
    Next j
End With

I am fairly new, and this one is REALLY overwhelming me. I hope everything makes sense. Thanks in Advance for any help.

- Hogie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top