Hi Guy
im trying to get this macro to copy data from excel files in folders it works but i need it to get data from excel files in sub-folders aswell can someone please help
Thanks
Please Login or Register to view this content.
Hi Guy
im trying to get this macro to copy data from excel files in folders it works but i need it to get data from excel files in sub-folders aswell can someone please help
Thanks
Please Login or Register to view this content.
Last edited by Hannspree; 10-21-2015 at 11:58 AM.
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
Click the * Add Reputation button in the lower left hand corner of this post to say thanks.
Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.
Describe the process you want to use to achieve your desired results.
For example: The names of the sub folder(s) will be in a range of cells, I choose which cells and the code does the rest or I want to hard code the sub folder names into the code.
Thanks for the reply
the excel files are all in random sub folders so it will need to loop though all the folders i need the code to do exactly what it does now but be able to find the excel files in sub folders to copy and paste the data into another excel file (sheet).
Thanks for the reply
the excel files are all in random sub folders so it will need to loop though all the folders i need the code to do exactly what it does now but be able to find the excel files in sub folders to copy and paste the data into another excel file (sheet).
That might be a little too much for me.
I'm sure someone with more knowledge than I will pick up the ball here.
If I don't see a response in a couple of hours, I'll send someone a PM and ask them to look at it.
Thanks !!!!
Hi Hannspree,
Because you are wanting to find and import RANDOMLY named data, I'd suggest you try the Application.FindFile method. This will bring up a dialog where you can manually select the file you want to use/import.
See if adding this manual process in your code helps with determining the randomness of your work.
If this doesn't do what you need then look at the "Dir" function. A good example of how it runs through all the files in a directory is at:
http://www.excel-easy.com/vba/exampl...directory.html
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
Is no way to go though subfolders ? i wanted to make it so they just type in a number and it copied the data in to the sheet the number they type in is the file directory but sometimes its in a folder inside the directory if that make sense
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks