*see end of this message for the solution*
Hi all,
I am trying to to create a macro that pops up the "open file" messagebox, you select a folder and it will go on to loop through all the .xls files in that folder and perform some data collecting function.
I have managed to form the data collecting part but can't figure out how to create the loop that will open and read all the xls files. Therefore I have resorted to hardcoding the filename of each file into my macro but this is not convenient as I have to use the same technique for other parts of my workbook and I can't update the filename every time I want to use the workbook with another set of files.
Attached is my example and I also copy it here:
Summary:
All the files I want to open are excel files
** They are all in one folder which I want to select every time I run the macro
What I want to do after I open every file is to copy/paste-values-only specific columns (2 in number right now) to specific worksheet/columns in my other workbook where the macro is called from.
If you could show me a way to grab the filename and print it in a specific cell that would be a bonus.
Thank you in advance for any advice or help.
Kostas
** I have found the vba code that allows me to open into a specific folder and then I can navigate through it here:
. Here it is:
and it's being called through another routine
--Solution by Leith--
Bookmarks