Archive of Mr Excel Message Board


Back to General Excel archive index
Back to archive home

.txt-export - select whole workbook and mark each row

Posted by Alex Kerste on October 26, 2000 5:23 AM
Hello!
Thanks to
2433a.html
A large part of my problem with exporting an excelfile from Excel 97 to a .csv-File automatically it has already been solved by you, thanks.
Yet, I've still got two more problems:

How do I select the whole workbook and
Is there a way to put some special character or entry (lets say "EndOfLine!") at the end of every row of the original worksheet?

This is the code I currently use:

Sub AlsTextSpeichern()
Dim MyRg As Range
Dim TextCell As Range
Dim TxtToWrite As String

Set MyRg = Range("a1:J155")
For Each TextCell In MyRg
TxtToWrite = TxtToWrite & TextCell.Text & Chr(124)
Next
Open "C:\Test.txt" For Output As #1
Print #1, TxtToWrite
Close #1

End Sub

Thank you,
Alex


Re: .txt-export - select whole workbook and mark each row

Posted by Ivan Moala on October 27, 2000 5:24 AM


Alex
I beleive Chip Pearsons site has what you require
so rather then recreating the wheel have a look @
http://www.cpearson.com/excel


Ivan


Re: .txt-export - select whole workbook and mark each row

Posted by Alex Kerste on October 31, 2000 7:28 AM

Thanks for the link, it's nearly exactly what I was looking for.
Alex


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.