Pestomania
Active Member
- Joined
- May 30, 2018
- Messages
- 332
- Office Version
- 365
- Platform
- Windows
I'm going to try to explain the best I can!
I have an excel open (Workbook1) currently. There are part numbers in Column A.
I need a VBA to go to a folder named "Pipe" on my desktop and open the Last Modified file(Workbook2). Once open the VBA needs to go to the "Workbook1" and create a new worksheet. Once the new sheet is created, I wanted to copy and paste the data from Workbook2 to Workbook1. Once complete, close Workbook2 without saving.
I hope this makes sense. I have tried a few different codes, links below, but unable to get them to work properly.
https://www.exceltip.com/excel-macros-and-vba/vba-to-open-latest-file.html
I am unable to get the MyFile = DIR to work. States argument is invalid but I copied verbatim.
https://www.mrexcel.com/forum/excel...subfolder-vba-excel-2010-a-2.html#post3656440
Any help is greatly appreciated.
I have an excel open (Workbook1) currently. There are part numbers in Column A.
I need a VBA to go to a folder named "Pipe" on my desktop and open the Last Modified file(Workbook2). Once open the VBA needs to go to the "Workbook1" and create a new worksheet. Once the new sheet is created, I wanted to copy and paste the data from Workbook2 to Workbook1. Once complete, close Workbook2 without saving.
I hope this makes sense. I have tried a few different codes, links below, but unable to get them to work properly.
https://www.exceltip.com/excel-macros-and-vba/vba-to-open-latest-file.html
I am unable to get the MyFile = DIR to work. States argument is invalid but I copied verbatim.
https://www.mrexcel.com/forum/excel...subfolder-vba-excel-2010-a-2.html#post3656440
Any help is greatly appreciated.