Scroll down 1 or 2 pages and you will find the question :
Exporting data to a text file - John 17:11:03 01/07/02
With the following solution :
13112.html - Ivan F Moala 22:18:38 01/07/02 (0)
The code of Ivan has a module to write and a module to read the text file...
Bruno
-----
I only need to add a line break after each record and I can't figure out which part of the macro does it.
See next code : every time you use
"Print #1, TxtToWrite" a line feed is autom. added...
Example 1
When you use :
Print #1, A
Print #1, B
Print #1, C
This is the result :
A
B
C
=========
Example 2
When you use :
Print #1, A,B,C
This is the result :
A B C
Bruno
-----
Sub WriteRangeCellsText()
Set MyRg = Range("A1:A5")
Open "C:\Windows\Desktop\Test.txt" For Output As #1
For Each ocell In MyRg
TxtToWrite = ocell.Text
Print #1, TxtToWrite
Next
Close #1
End Sub
Thanks to you, I have now finished a project I have given 17hrs a day for the last 4 days. I can eat now!
I can see that coming in very usefull in the future too!
The real guy to thank is Ivan F Moala
He posted the code before...
I'm only the midget to explain a few things ;-)
Bruno
-----