Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening txt files as Excel spreadsheet

Status
Not open for further replies.

Jonathan123

Programmer
Jun 29, 2001
20
0
0
US
I have a text file that contains a load of info. It really is tab delimited. Excel converts it into mult. columns as it assumes that since it is tab delimited that they are mult. fields. I, however, want it all in the 'A' column . WorkBooks.open(fileName.txt) is what I am using to open it.

A long work around is that I can open it as a text file read each line and then add the line to the A column as the value.

Perhaps someone knows how I can tell excel not to brake it up so I can open it directly in excel?
Thanks
 
I just found this function:

Workbooks.OpenText(Filename, Origin, StartRow, DataType, TextQualifier, ConsecutiveDelimiter, Tab, Semicolon, Comma, Space, Other, OtherChar, FieldInfo)

has anyone had any experience using it?

"DataType Optional Variant. Specifies the column format of the data in the file. Can be one of the following XlTextParsingType constants: xlDelimited or xlFixedWidth. The default value is xlDelimited."

I think it is the data type field that I need to flag.

Jonathan123
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top