Hard return in concatenate

P

Pete_UK

Like this:

=A1 & CHAR(10) & B1

CHAR(10) is the linefeed character (equivalent to Alt-Enter when you
do it manually).

Hope this helps.

Pete
 
D

Dave Peterson

As a formula:
=a1&char(10)&"This is the second line"&char(10)&text(b1,"$#,##0.00")
(and format the cell for wraptext--or you'll see a little box for that
char(10).)

As input, you hit alt-enter to force a new line within the cell.

in code:
dim myStr as string
mystr = "Something" & vbnewline & "something else" & vblf & "a third thing"

vbnewline will work for both Mac's and PC's.
vbLf is enough for PC's.
 
K

Khoshravan

A1=Apple B1=Orange
I was expecting by this formula to get:
Apple
Orange (In two lines in a cell)
But I get:
AppleOrange
Char(10) didn't work for me.
I am using Excel 2003
 
R

Rasoul Khoshravan

Hi,

You will have to wrap text (from Format cells)

--
Regards,

Ashish Mathur
Microsoft Excel MVPwww.ashishmathur.com

Thanks. That was a point missed on replies.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top