Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to change xls format to text?

Hi, Everybody,

Now I have a problem about the format changes. I have a document i
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 th
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

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Date Format to Specific Text Format When Copying [email protected] Excel Discussion (Misc queries) 4 December 23rd 08 03:43 PM
Change number (in text format) to numeric format Pam Excel Discussion (Misc queries) 5 October 24th 05 07:45 PM
How to change text format .126 to number format 0.126 ? vitality Excel Worksheet Functions 2 October 6th 05 01:02 PM
How do i change numbers in text format to number format? Greg New Users to Excel 1 December 14th 04 05:22 PM
Change date format to text format Hande Excel Programming 0 November 14th 03 01:37 PM


All times are GMT +1. The time now is 09:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"