schroederdj
New Member
- Joined
- Jun 21, 2022
- Messages
- 14
- Office Version
- 365
- Platform
- Windows
Hi everyone. I have a procedure to copy a worksheet from from a daily file into a separate monthly combined file. each additional day gets copied to the monthly file. The issue is that the daily file I get has a different file name each day. ("AYS Reconciliation 2023-06-08-08-16-19.xlsx") The sheets in the daily file have the same name each day. I was wondering if there was a way when selecting the file "AYS Reconciliation 2023-06-08-08-16-19.xlsx" it could be truncated to equal "AYS Reconciliation". Then I could source the same file name each day to copy into the monthly workbook. (I change the sheet name each day in the monthly file so there would not be a duplicate sheet name in the monthly file). Both files would be open on my desktop when running the macro so the macro does not need to do an open or save. Thanks for your help
Windows("AYS Reconciliation 2023-06-08-08-16-19.xlsx").Activate
Sheets("Division 27 Current Month").Select
Sheets("Division 27 Current Month").Copy Before:=Workbooks( _
"June 23 Factory.xlsm").Sheets(1)
Windows("AYS Reconciliation 2023-06-08-08-16-19.xlsx").Activate
Sheets("Division 27 Current Month").Select
Sheets("Division 27 Current Month").Copy Before:=Workbooks( _
"June 23 Factory.xlsm").Sheets(1)