Excel v10. Extra lines printing to Text file
I ran this code with your line included and couldn't reproduce your problem.
Are you sure you aren't just seeing line wrap?
Sub AA()
Dim num As Long
Dim sStr As String
Dim ThisLine As String
num = FreeFile()
Open "C:\mytest.txt" For Output As #num
For i = 1 To 10
sStr = ""
For j = 1 To 10
If sStr = "" Then
sStr = Cells(i, j)
Else
sStr = sStr & ", " & Cells(i, j).Text
End If
Next
ThisLine = sStr
Print #num, ThisLine
Next
Close #num
End Sub
--
Regards,
Tom Ogilvy
"SMS - John Howard" wrote in message
...
In using excel's Print #Num, ThisLine.
'ThisLine' is produced in VBA by concatenating each cell in a specified
row.
I am getting all the data into Notepad perfectly spaced and formatted.
Trouble is I am getting an extra blank row below each line of data also.
These are having to be manually deleted prior to a batch main frame
upload.
How do I suppress the extra lines.?
TIA
John Howard
Sydney, Australia
|