Avatar of tooireland8325
tooireland8325Flag 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
Avatar of Surone1
Flag of Suriname image

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


Of course it would!!  My apologizes I thought I had attached my file.
Avatar of Ejgil Hedegaard
Ejgil Hedegaard
Flag of Denmark image

Blurred text
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
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo