Excel does what it thinks is right.
You could use a macro and write code and have complete control over what you
write.
Here are three sites that you could steal some code from:
Earl Kiosterud's Text Write program:
www.smokeylake.com/excel
(or directly: http://www.smokeylake.com/excel/text_write_program.htm)
Chip Pearson's:
http://www.cpearson.com/excel/imptext.htm
J.E. McGimpsey's:
http://www.mcgimpsey.com/excel/textfiles.html
Earl's program may work right out of the box.
> Hello all,
>
[quoted text clipped - 6 lines]
>
> Thanks

Signature
Dave Peterson
qu4dman - 11 Jul 2007 07:15 GMT
> Excel does what it thinks is right.
>
[quoted text clipped - 26 lines]
>
> Dave Peterson
I did not say that Excel does a bad job :) Hehe.
I found a macro and that does what I need. I thought of programming
such a macro but as there are many one out there, I use them :)
Thank you :)
qu4dman - 11 Jul 2007 07:19 GMT
> Excel does what it thinks is right.
>
[quoted text clipped - 26 lines]
>
> Dave Peterson
Just in case this could help others in the same case and that would
get on this thread, the VBA macro I use is the following one, that can
be found on the URL
http://www.developerfood.com/comma-delimited-export/microsoft-public-excel/366c6
ba2-336b-4e8f-bc06-5298ee062614/article.aspx
I Public Sub TextNoModification()
Const DELIMITER As String = vbTab
Dim myRecord As Range
Dim myField As Range
Dim nFileNum As Long
Dim sOut As String
nFileNum = FreeFile
Open "D:\outputfiles\datafile1.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(1), _
Cells(.Row, Columns.Count).End(xlToLeft))
sOut = sOut & DELIMITER & myField.Text
Next myField
Print #nFileNum, Mid(sOut, 2)
sOut = Empty
End With
Next myRecord
Close #nFileNum
End Sub
Dave Peterson - 11 Jul 2007 11:42 GMT
This is JE McGimpsey's code just posted (without attribution) somewhere else.
And by the way, you may have wanted to try Earl Kioserud's workbook. It offers
options and may require less knowledge of VBA than the others.
> > Excel does what it thinks is right.
> >
[quoted text clipped - 54 lines]
> Close #nFileNum
> End Sub

Signature
Dave Peterson