Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 convert into tab delimeter text file with extra tab spa Naresh kumar[_2_] Excel Discussion (Misc queries) 0 March 30th 10 03:48 PM
When printing second copy, extra lines appear thanksforhelping Excel Discussion (Misc queries) 1 June 18th 08 11:10 PM
How to delete extra pages at end of excel file when printing Michelle Excel Discussion (Misc queries) 2 January 29th 08 06:27 PM
Inserting extra lines for comments in an excel sheet LittleAnn Setting up and Configuration of Excel 3 October 31st 07 11:31 PM
excel97 vba to append lines to text file overwriting last 2 lines Paul Excel Programming 1 November 6th 04 08:11 PM


All times are GMT +1. The time now is 04:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"