Dlookup in Excel Files... Or something similar. (1 Viewer)

TobyMace

Registered User.
Local time
Today, 18:40
Joined
Apr 13, 2018
Messages
65
Hi,

I am hoping there is a way to lookup a value in multiple excel files from Access VBA.
There are multiple excel files in location "F:\EVERYONE\Toby" that all start with "SP2240-170" and end with a date range. This date range will be generated by the Excel file automatically based on data contained within so I will not know the file names in advance when future files are created or what date range my value will be contained within. "SP2240-170" will remain constant.
I basically want to look up a value, say "1234", in column E:E of every excel file the begins with "SP2240-170" and record values of column F:F and G:G in a table or query or textbox I don't mind.
That value may appear in more than file also so I would require the search to continue through the rest of the files even after a match has been found.
Many thanks in advance for any help.
 

Gasman

Enthusiastic Amateur
Local time
Today, 18:40
Joined
Sep 21, 2011
Messages
14,272
Loop through all the files in the folder named as you require, copy each in turn to MyLinkedExcelFile.xls
That file is linked in your DB, then work on that table with a Dlookup or query. ?
 

TobyMace

Registered User.
Local time
Today, 18:40
Joined
Apr 13, 2018
Messages
65
That's a good idea! Why didn't I think of that...
Thank you!
 

Users who are viewing this thread

Top Bottom