VBA - Importing CSV files with blank fields to Access

AHalpain

New Member
Joined
Jan 6, 2012
Messages
12
Good evening everyone,

I have a data set of 500+ CSV files with more than 50K lines of data in each. Through out the data there are a number of empty cells. Unfortunately none of the cells as a fixed width or anything like it. I have included the code I am using to transfer the data in and a sample of a table similar to what I am facing. The question I have to the collective Guru's here is what do I need to update, change or add to keep these blank fields in the data set while not losing any data integrity?



The code I have is:

Workbooks.OpenText filename, , , xlDelimited, xlTextQualifierNone, True, True


A Sample file would be:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Name
[/TD]
[TD]Sandwhiches
[/TD]
[TD]Pasta
[/TD]
[TD]Drinks
[/TD]
[TD]Tables
[/TD]
[TD]Color
[/TD]
[/TR]
[TR]
[TD]Cory
[/TD]
[TD]18
[/TD]
[TD]43
[/TD]
[TD]7
[/TD]
[TD]12
[/TD]
[TD]Yellow
[/TD]
[/TR]
[TR]
[TD]Tapenga
[/TD]
[TD]12
[/TD]
[TD][/TD]
[TD][/TD]
[TD]43
[/TD]
[TD]Purple
[/TD]
[/TR]
[TR]
[TD]Eric
[/TD]
[TD][/TD]
[TD]14
[/TD]
[TD][/TD]
[TD]700
[/TD]
[TD]Red
[/TD]
[/TR]
[TR]
[TD]Mr. Feeny
[/TD]
[TD]170
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Black
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi,

are you having trouble when uploading the data to access?

also how are you uploading the data to access? via excel or via access direct?
 
Upvote 0
I am trying run it directly through the VBA to run it in the background So i guess that would be directly into access.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,774
Members
452,353
Latest member
strainu

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