LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Print with no line feed

I think it's a little harsh to scold the OP because he didn't RTFM. Here's
what my help file says:

Use a semicolon to position the insertion point immediately after the last
character displayed.

and

Multiple expressions can be separated with either a space or a semicolon. A
space has the same effect as a semicolon.

I don't think it's at all clear that the semi-colon accomplishes what the OP
asked. I recall that it took me some time to figure out how to do exactly
what the OP wanted to do. I don't know about others but I think this is
just one example of frequently obfuscated MS documentation.

Luke

"Rick Rothstein (MVP - VB)" wrote in
message ...
Did you try either of what Dave posted? If you look carefully at the
second one, you will see a semi-colon after the Print statement
argument... that tells the Print statement to suppress the line feed
(actually, it is a carriage return followed by a line feed the Print added
to your output and it is this combination that the semi-colon suppresses).
By the way, this is covered in the help files for the Print# Statement
(which I am guessing you didn't read).

Rick


wrote in message
...
No silly.

Is there a way to tell Print not to add the line feed?


On Feb 18, 3:31 pm, Dave Peterson wrote:
Sub Write2()
Open "C:\output.txt" For Output As #1
Print #1, "hello world"
Close #1
End Sub

or maybe...

Sub Write2()
Open "C:\output.txt" For Output As #1
Print #1, "hello";
Print #1, " world";
Close #1
End Sub





" wrote:

I have:


Sub Write2()
Open "C:\output.txt" For Output As #1
Print #1, "hello"
Print #1, " world"
Close #1
End Sub


Which creates a file that looks like


hello
world


Is there a way to tell Print not to add the line feed - so I can get


hello world


Thanks.


--

Dave Peterson- Hide quoted text -

- Show quoted text -




 
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
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? No Name Excel Worksheet Functions 7 October 7th 09 11:10 AM
CSV line feed delimitter Janne Excel Programming 2 December 17th 07 07:28 PM
Line Feed in Formula Bar Stratuser Excel Programming 1 January 29th 07 05:03 PM
Line Feed Nigel Bennett Excel Programming 2 February 17th 05 07:07 AM
how does excel store new line and line feed characters? ben h[_2_] Excel Programming 0 July 1st 04 02:34 AM


All times are GMT +1. The time now is 12:23 PM.

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

About Us

"It's about Microsoft Excel"