View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default How to change xls format to text?

One way:


Public Sub NullSV()
Dim myRecord As Range
Dim myField As Range
Dim sOut As String

Open "Test.txt" For Output As #1
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 #1, sOut
sOut = Empty
End With
Next myRecord
Close #1
End Sub


In article ,
Together wrote:

Hi, Everybody,

Now I have a problem about the format changes. I have a document in
Excel, and I want to change the excel file to text file. For instance,
in excel, the value in Cells(1,A)=5, Cells(1,B)=6
I want the file in text is like: 56. But generally, when I transfer the
file, I find that in text it is 5 6. There is a space between 5 and 6.
How can I delete the space? Thank you.