Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default populating a cell with text w/ line breaks

I have always used "vbCR" instead of "vbCRLF". Does the
"vbCRLF" add an additional line feed??
-----Original Message-----
Joe

In XL2003 this worked

Sub test()
ActiveCell.Value = "Ben" & Chr(10) & "Hur" & Chr(10) &

"Gladiator"
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England



"Joe" wrote in message
...
I am using XL 2002. I need to populate cells with data

that has been
created using the vbcrlf constant (i.e. data value = "Ben"

& vbcrlf & "Hur"
& vbcrlf & "gladiator").

When I populate the cell with the data value above it

appears double
spaced, like this:

Ben

Hur

gladiator

I want it to apepar like this:

Ben
Hur
gladiator

What is the vb constant used to create the Alt+Enter

line break while
populating a cell?

TIA,
--
Joe

VBA Automation/VB/C++/Web and DB development



.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default populating a cell with text w/ line breaks

Hi SidBoard,

From Help:

vbCrLf Chr(13) + Chr(10) Carriage return-linefeed combination

vbCr Chr(13) Carriage return character
vbLf Chr(10) Linefeed character
vbNewLine Chr(13) + Chr(10)


---
Regards,
Norman

"SidBord" wrote in message
...
I have always used "vbCR" instead of "vbCRLF". Does the
"vbCRLF" add an additional line feed??
-----Original Message-----
Joe

In XL2003 this worked

Sub test()
ActiveCell.Value = "Ben" & Chr(10) & "Hur" & Chr(10) &

"Gladiator"
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England



"Joe" wrote in message
...
I am using XL 2002. I need to populate cells with data

that has been
created using the vbcrlf constant (i.e. data value = "Ben"

& vbcrlf & "Hur"
& vbcrlf & "gladiator").

When I populate the cell with the data value above it

appears double
spaced, like this:

Ben

Hur

gladiator

I want it to apepar like this:

Ben
Hur
gladiator

What is the vb constant used to create the Alt+Enter

line break while
populating a cell?

TIA,
--
Joe

VBA Automation/VB/C++/Web and DB development



.



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
Wrapping text with line breaks problem CC91884 Excel Discussion (Misc queries) 1 March 10th 09 04:33 PM
Text to Columns with Line Breaks. eSite Excel Discussion (Misc queries) 3 May 2nd 08 02:44 PM
Inserting line breaks in text formula J M Shelton Excel Discussion (Misc queries) 6 September 30th 07 06:31 AM
remove line breaks in text strings Capn Swing New Users to Excel 1 January 2nd 07 04:54 PM
Can you get line breaks in a text cell RFJ Excel Discussion (Misc queries) 3 November 9th 05 07:20 PM


All times are GMT +1. The time now is 02:48 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"