Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Simple Question (insert new line)

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Simple Question (insert new line)

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

in VBA, it is CHR, not CHAR

--
Regards,
Tom Ogilvy


"Joe D" wrote in message
oups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Simple Question (insert new line)

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


--

HTH

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


"Joe D" wrote in message
oups.com...
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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Simple Question (insert new line)

Thanks Tom

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
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Missing a line (Simple) Jayhawktc[_4_] Excel Programming 1 August 11th 04 06:42 PM
simple question, hopefully a simple answer! Matt B Excel Programming 5 January 13th 04 08:43 PM
Simple Insert Picture question Paul Excel Programming 1 September 15th 03 08:37 PM


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