creating text file without delimiters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know how to create a text file without
delimiters from an excel doc. I need to create this file
to use as import to another application. I would really
like to just save it without the delimiters. For example,
there are three columns in excel doc.

col 1 col 2 col 3
52 100 13321

I want to save the data to look like 5210013321 without
any spaces, commas or other delimiters.

Thanks in advance
 
One way:

Public Sub NoDelimiterSV()
Dim myRecord As Range
Dim myField As Range
Dim nFileNum As Long
Dim sOut As String

nFileNum = FreeFile
Open "Test.txt" For Output As #nFileNum
For Each myRecord In Range("A1:A" & _
Range("A" & Rows.Count).End(xlUp).Row)
With myRecord
For Each myField In Range(.Cells, _
Cells(.Row, Columns.Count).End(xlToLeft))
sOut = sOut & myField.Text
Next myField
Print #nFileNum, sOut
sOut = Empty
End With
Next myRecord
Close #nFileNum
End Sub
 
anonymous,

The Text Write Program at www.tusher-mehta.com can do that. It's a workbook
with a macro that will write any sheet (or part of) from any open workbook
to a text file with lots of options. In the Setup sheet, you leave out the
specification for record delimiter, and you're good to go. Your cells will
probably already have to have the correct fixed number of characters for the
reading program to parse the fields properly.
 
Hi!

And if you don't want to use VBA you could create a column with the other
three concatenated (=A1 & B1 & C1)

Alf
 
Back
Top