VBA code to import Txt file in existing table in Access with comma delimiter

Roushan

New Member
Joined
Jun 7, 2013
Messages
28
Hi All,

I have to import data in existing table in Access from text file. Delimiter should be “comma”. I need VBA code for this.</SPAN></SPAN>

Please help.

Thanks in Advance!

Kind Regards,
Roushan
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
You can get this VBA code without even really knowing how to write VBA. Just do the following:

1. Go through the steps of importing the file manually. The Import Wizard will be invoked. Right before you click on the "Finish" step at the very end, click on the "Advanced" tab. Then click on "Save As", as give this Import Specification any name you like (and make note of it). You can then close the Import window.

2. Go to the Macro section and create a new Macro. Choose the "TransferText" Action (if you do not see this action available, click on the Show All Actions button). Then enter "Import Delimited" as the Transfer Type, and enter your Import Specification name, Table Name, and File Name. Save this Macro and close it.

3. Highlight the Macro, and from the Database Tools menu, click on the "Convert Macros to Visual Basic" button. This will give you the VBA code that you need.
 
Upvote 0

Forum statistics

Threads
1,221,469
Messages
6,160,027
Members
451,611
Latest member
PattiButche

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