Simple Question (insert new line)

J

Joe D

Currently I have code that looks something like this:

thisCell.Value = thisCell.Value & " " & newCell.Value

Which adds the new value to the old value, separated by a space.
However, I would rather have this line of code insert a line break. In
the formula bar, CHAR(10) works for this, but I tried to just replace
the space(" ") with CHAR(10) and Excel complains about it. What is the
correct way to insert a line break?

Thanks to anyone who responds,
Joe
 
T

Tom Ogilvy

thisCell.Value = thisCell.Value & chr(10) & newCell.Value

in VBA, it is CHR, not CHAR
 
B

Bob Phillips

thisCell.Value = thisCell.Value & Chr(10) & newCell.Value


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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