chingg1011
New Member
- Joined
- Oct 8, 2021
- Messages
- 18
- Office Version
- 365
- 2010
- Platform
- Windows
- Mobile
hi vba expert,
I m setting a macro to copy data from one excel to my workbook excel, but it involved in more than one source file (abc 20231231.xls, xyz20231231.xls...etc)
when I done on 1st file (abc.xls), I would close it, and open another file (xyz.xls) to copy another data to my workbook.
the code is showing a problem below
window(abc20311231.xls).close
my problem is the data file name is variable every month (abc20240131.xls), how to write the code to avoid running marco failure ? address the specific window file to close
Dennis
I m setting a macro to copy data from one excel to my workbook excel, but it involved in more than one source file (abc 20231231.xls, xyz20231231.xls...etc)
when I done on 1st file (abc.xls), I would close it, and open another file (xyz.xls) to copy another data to my workbook.
the code is showing a problem below
window(abc20311231.xls).close
my problem is the data file name is variable every month (abc20240131.xls), how to write the code to avoid running marco failure ? address the specific window file to close
Dennis