Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel v10. Extra lines printing to Text file
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 convert into tab delimeter text file with extra tab spa | Excel Discussion (Misc queries) | |||
When printing second copy, extra lines appear | Excel Discussion (Misc queries) | |||
How to delete extra pages at end of excel file when printing | Excel Discussion (Misc queries) | |||
Inserting extra lines for comments in an excel sheet | Setting up and Configuration of Excel | |||
excel97 vba to append lines to text file overwriting last 2 lines | Excel Programming |