Automating Converting Text File Into Excel Format Using VBA

S

SerialNumberOne

I am not a programmer so I need some help. I have a comma separated
file that I would like to automatically convert into an XLS file using
a VBA routine.

Text file format has

field1, field2, field3,

data is collected over a 24-hr period. At the end would like to write
the collected data converted into and excel file that has a header
defined as

FIELD1 FIELD 2 FIELD 3
1data1 1data2 1data3
2data1 2data2 2data3
3data1 3data2 3data3
4data1 4data2 4data3

Is this possible?




x-- 100 Proof News - http://www.100ProofNews.com
x-- 3,500+ Binary NewsGroups, and over 90,000 other groups
x-- Access to over 1 Terabyte per Day - $8.95/Month
x-- UNLIMITED DOWNLOAD
 
M

mudraker

SerialNumberOne

this is one command to open a csv file


Workbooks.Open FileName:="D:\My Documents\CSVExport.csv"


or to open a text file with comma seperated fields




Workbooks.OpenText FileName:="c:\My Documents\TestFile.txt", _
Origin:=xlWindows, StartRow:=1, DataType:=xlDelimited
TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False
Semicolon:=False _
, Comma:=True, Space:=False, Other:=False
FieldInfo:=Array(Array(1, 1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top