I was hoping someone could write a quick VB program for me (I’m not very good at coding). Here is what I need it to do:

There are two filenames on a sheet. These filenames are located in M1 and M2. The filenames can change, but the files they represent are located in the same folder/directory as the main Excel spreadsheet.

The macro needs to open the file located in M1. It then copies the data in columns A:D in that workbook and pastes the values in columns A:D of the main Excel spreadsheet (same sheet that we just pulled data from M1). There is only one tab in the external file, but that tab name/sheet name may be different for each external file. The macro should then close the external file.

This process should be repeated on the file located in M2. In this situation the macro copies the data in columns A:B and pastes values the data in columns F:G of the main Excel spreadsheet.

That is all I need the macro to do!

NOTE – When I open these external files, since they were generated by a non-Microsoft program, I always get prompted with the question “Excel found unreadable content in filename. Do you want to recover?”. The answer is always YES – the workbook always open and looks just fine. After answering YES Excel will prompt “Excel recovered your formulas and cell values, but some data may have been lost”. The answer to this prompt is always CLOSE.

NOTE2 – I’m importing external financial data from a 3rd party program into Excel. I have to perform this process on several different companies several times a month. It is a very repetitive process that I’m hoping to replace with a quick macro. I don’t want to actually link to the external files because they are fairly large and it several hinders the performance and size of the master spreadsheet. Thus, I just want to paste in the values.

Thank you very much for your help.