Try this mode (Untested !)
Sub WriteRangeCellsText()
Dim MyRg As Range
Dim TextCell As Range
Dim TxtToWrite As String
Set MyRg = Range("a1:D1")
For Each TextCell In MyRg
TxtToWrite = TxtToWrite & TextCell.Text & chr(13)
Next
Open "C:\Windows\Desktop\Test.txt" For Output As #1
Print #1, TxtToWrite
Close #1
End Sub
Ivan
Thank you for the information, I still have one problem, the text file is being generated now but the format needs to be changed.
all the data is put on one line such as
xxxxyyyyxxxxyyyy
but I need it in the following format
xxxx
yyyy
xxxx
yyyy
xxxx
yyyy
ect.....
Jason
Thank you for the information, I still have one problem, the text file is being generated now but the format needs to be changed.
all the data is put on one line such as
xxxxyyyyxxxxyyyy
but I need it in the following format
xxxx
yyyy
xxxx
yyyy
xxxx
yyyy
ect.....
Jason
Thank you again, after testing the program below
I changed the "char(13)" to "vbCrLf" and It gave
me the format that I needed.
Thank you for the information
Sub WriteRangeCellsText()
Dim MyRg As Range
Dim TextCell As Range
Dim TxtToWrite As String
Set MyRg = Range("a1:a65")
For Each TextCell In MyRg
TxtToWrite = TxtToWrite & TextCell.Text & vbcrlf
Next
Open "C:\Windows\Desktop\Test.txt" For Output As #1
Print #1, TxtToWrite
Close #1
End Sub
Try something like this
Sub WriteRangeCellsText()
Dim MyRg As Range
Dim TextCell As Range
Dim TxtToWrite As String
Set MyRg = Range("a1:D1")
For Each TextCell In MyRg
TxtToWrite = TxtToWrite & TextCell.Text
Next
Open "C:\Windows\Desktop\Test.txt" For Output As #1
Print #1, TxtToWrite
Close #1
End Sub
This save the text in the set range as a sequential
ouput file to your desk top.
Change as neccesary
Ivan