Accessing multiple excel workbooks/sheets

bucci35

Active Member
Joined
Jul 6, 2002
Messages
350
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have 15 workbooks that are updated by 15 stores. Weekly I pull them back to my desktop via remote access.
I need to access a few cells within each workbook/sheet and pull them to a blank workbook/sheet/cell.
Each week the names changes on all 15 by the weekending date and always preceded by the store number ex. 05_091606 with an underscore between the store number and the date.
I was wondering if their was a way to create a macro or something in a blank workbook that would access all of these automatically to make life easier?
Any ideas?

Thanks,
Dan
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
'C:\Documents and Settings\Dan\Desktop\01_092306.xls' could not be found. Check the spelling of the file name, and verify that the file location is correct.

The file that I have currently open that I'm trying to access is 05_092306.
 
Upvote 0
Does a file called 01_092306.xls exist in that directory?

If it doesn't you'll get the error because that's the file the code is looking for.

It isn't looking for a file called 05_092306.
 
Upvote 0
No thier isn't a file named that right now, but when all stores are done their will be. Right now I"m looking for just store #5. Eventually thier will be 15 stores that I'm looking for with the same weekending date which will change every week
 
Upvote 0
Well your best option would be to put all the files you currently have in one folder.

Then you can have code that only looks at the files that are in that folder.

You can do this using Application.FileSearch, Dir or using the File System Object.

Try a board search, that should yield plenty of examples as this is a common request.
 
Upvote 0
put this after strName = yourpath, etc and see if it is correct:
Code:
Debug.Print strName
What Excel version and OS version are you using? Seems like one of the older ones required double quotes around embedded spaces in paths. Try manually copying a couple files down to the C:\ path and see if that makes a difference. Good Luck!
 
Upvote 0
sbendbuckeye

As far as I can see the file 01_092306.xls doesn't actually exist yet.
 
Upvote 0
I can put all the files in a folder on my desktop labeled "labor", but I"m really not good enough to go any further than this. Could you possible rigth the macro for me? I hate to be a pain, but this is out of my reach as far as my ability in excel.

Thanks
 
Upvote 0
Hello bucci35,

For testing purposes

A. Create a test folder
B. Copy old versions of all 15 store/date files into the test folder or else copy one version 14 times and then rename them appropriately
C. Change the macro code above to use the test folder from A
D. Run the code and let us know if it works

Good Luck!
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

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