M
Mike Field
Using Excel 2000 v9.0
I have a list of records needing to be exported to a text
file.
What I am looking for is to output all records terminated
by a CR and no LF.
Example:
AB016593AY22001816P3404RS CHR(13) AB022350AY22201022P9920
CHR(13) AB022189AY18401823502031RS CHR(13)
My list will allways be in a single column with no breaks.
The following code works, but includes Hex OD 0D 0A at the
end of each record, removing & Chr(13) from the Print
statement will still result in 0D 0A.
Sub ExportTrans()
Count = 0
Sheets("Transactions").Select
Range("A1").Select
FilePath = [AppPathName] & "FADSMant.TXT"
Close #1
On Error Resume Next
Open FilePath For Output As #1
While ActiveCell.Value <> ""
Print #1, ActiveCell.Offset(Count, 0).Value & Chr
(13)
Count = Count + 1
If ActiveCell.Offset(Count, 0).Value = "" Then
GoTo DropOut
Wend
DropOut:
Print #1, [DayToClear] & Chr(13)
Close #1
Exit Sub
Thanks,
Mike Field
I have a list of records needing to be exported to a text
file.
What I am looking for is to output all records terminated
by a CR and no LF.
Example:
AB016593AY22001816P3404RS CHR(13) AB022350AY22201022P9920
CHR(13) AB022189AY18401823502031RS CHR(13)
My list will allways be in a single column with no breaks.
The following code works, but includes Hex OD 0D 0A at the
end of each record, removing & Chr(13) from the Print
statement will still result in 0D 0A.
Sub ExportTrans()
Count = 0
Sheets("Transactions").Select
Range("A1").Select
FilePath = [AppPathName] & "FADSMant.TXT"
Close #1
On Error Resume Next
Open FilePath For Output As #1
While ActiveCell.Value <> ""
Print #1, ActiveCell.Offset(Count, 0).Value & Chr
(13)
Count = Count + 1
If ActiveCell.Offset(Count, 0).Value = "" Then
GoTo DropOut
Wend
DropOut:
Print #1, [DayToClear] & Chr(13)
Close #1
Exit Sub
Thanks,
Mike Field