How To Do A VBA CSV Import For One To Multiple Files

So you want to be able to import your csv for 1 to multiple files. Here’s how you do it.

1. up a form with a button.

2. After you click the button, you will get a File Dialog Box that will show you the csv files to choose from:

Here is the code behind the “Import” button:

Since you are going to get the annoying “ImportErrors” tables, because we didn’t use a specification, you probably want to delete them. That’s why the “CleanUpStrayTables” procedure is here. It basically loops your tables and delete the ones called “ImportErrors”.

Here is what it will look like if you don’t use the “CleanUpStrayTables” procedure:

It’s pretty straight forward:

That’s all, let me you if you have questions, and share this with someone else.

Free! Subscribe To Our YouTube Channel!

facebooktwittergoogle_plusredditpinterestlinkedinmailby feather
Tags: , , , ,




 

Call Erik Now