Hello!
I tried to come up with a solution that can make my job easier but for some reason it's not very consistent. I will mention that I am quite new to the world of VBA and Excel but I'm trying to learn a few tricks, so bare with me please.
This is my problem: I have to add several separate excel files in one spreadsheet so that I can make a report on that data. Because sometimes there are quite a lot of files I tried to figure out a way to add them automatically. Every file basically looks like this:
for excel forum.jpg
The files are saved daily and the usually have a filter active so I figured out a macro that does the following:
-first I have to get all the files I want to add into one folder
-then I open up a new spreadsheet, open VBA and paste my macro in and run it
-then the macro opens every excel file,clears the filters,selects every row of data except the first row,copies them in the new spreadsheet and closes the excel files without saving any changes.
-after it's done I insert the first row into my new spreadsheet and start working on the report.
So this saves up quite a lot of time but sometimes it doesn't work, it just adds the first row (the one with the First Name, Last Name, etc) from every excel file and no other row of data, and I don't really understand why.
Anyway, maybe someone can take a look at this macro and point out what's wrong, or even tell me if there is an easier way to do this.
This is the macro I came up with just by adding bits and pieces from the internet, so don't laugh pls.
Thank you for your time and patience, and hopefully for your help.![]()
Please Login or Register to view this content.
Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
Bookmarks