Avatar of tooireland8325
tooireland8325
Flag for United States of America asked on

Open multiple files by looping through a list

I need to do the following:
1.  open last years file from a specific folder for a list of values
2. open this year file from a specific folder for a list of the same values
3. copy and paste last years workbook into this years workbook
4. do some calculations and formatting in the mergered workbook
5. save the mergered workbook into a specfic folder

I have most everything working, I will admit that I am an Excel VBA hack, being self taught by searching out what I need to do from experts here and other internet findings.  My current struggel is if I cannot find a file for LY or a file for TY I want to skip that item in the list and move onto the next item in the list.

My file error method works for my first file, but it does not work for my second file and I don't know why.
Microsoft ExcelVBA

Avatar of undefined
Last Comment
Martin Liss

8/22/2022 - Mon
Surone1

it would help if you provided us with the actual code ;-)
tooireland8325

ASKER
Of course it would!!  My apologizes I thought I had attached my file.
CLI-Department-Report-Marco-with-loop.xl
ASKER CERTIFIED SOLUTION
Ejgil Hedegaard

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Martin Liss

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23