Open a CSV File with VBA Macro and copy/paste data to worksheet then close CSV and run Bat file within VBA macro

XCaliber

New Member
Joined
Jan 16, 2014
Messages
41
Hi,

I would like a macro to open any and all .csv files into excel (new window) found withing a specific directory one at a time (may need user prompt to keep organized). Once the code has opened the first .csv file and has focus on it, I have a macro in place to copy it's data and paste into an existing table's next empty row in a specific worksheet of an already opened workbook. After I have ran the macro said above, I need the code to close this newly created and temporary .csv file and open the next it finds in the specified path. If the code does not find any other .csv files then stop or tell me that it has stopped checking because there were no more to be found.

Is this possible?

If it is, how would this code be written ?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,214,999
Messages
6,122,645
Members
449,093
Latest member
Ahmad123098

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top