The Straight Dope

Go Back   Straight Dope Message Board > Main > General Questions

Reply
 
Thread Tools Display Modes
  #1  
Old 09-05-2007, 09:45 AM
The Great Sun Jester The Great Sun Jester is offline
Guest
 
Join Date: Mar 2004
Excel Question ... sorry about this.

I'm usually pretty good about getting Excel to dance to whatever tune I want to play, but this time I'm stumped and it's a really simple problem.

How do you concatenate a [carriage return] into a string?
Reply With Quote
Advertisements  
  #2  
Old 09-05-2007, 09:50 AM
Mangetout Mangetout is offline
Charter Member
 
Join Date: May 2001
Location: Kingdom of Butter
Posts: 47,666
<Alt><Enter>

Last edited by Mangetout; 09-05-2007 at 09:52 AM.
Reply With Quote
  #3  
Old 09-05-2007, 10:32 AM
sandra_nz sandra_nz is offline
Guest
 
Join Date: Jun 2005
I think the OP is wanting to preserve carriage returns in cells when CONCATENATE-ing but is finding they dissapear. Is that correct, OP?
Reply With Quote
  #4  
Old 09-05-2007, 11:03 AM
The Great Sun Jester The Great Sun Jester is offline
Guest
 
Join Date: Mar 2004
Interesting result there, Mr. Omnivore, and that may yet come in handy. But what I'm looking for is a character that can be concatenated between two strings that will induce a carriage return when the result is pasted into notepad/word document, etc.

The code would look something like: =concatenate(A23,?,B23,?,C23) and result in:

A23
B23
C23
Reply With Quote
  #5  
Old 09-05-2007, 11:09 AM
sandra_nz sandra_nz is offline
Guest
 
Join Date: Jun 2005
I have a feeling it's something like CHAR13?
Reply With Quote
  #6  
Old 09-05-2007, 11:20 AM
SCSimmons SCSimmons is offline
Guest
 
Join Date: Mar 2001
Quote:
Originally Posted by sandra_nz
I have a feeling it's something like CHAR13?
Very close, sandra. It's CHAR(10).
__________________
-Christian
"You won't like me when I'm angry. Because I always back up my rage with facts and documented sources." -- The Credible Hulk
Reply With Quote
  #7  
Old 09-05-2007, 11:47 AM
The Great Sun Jester The Great Sun Jester is offline
Guest
 
Join Date: Mar 2004
=char(10) and =char(13) both work fine when I paste the result into Word. Neither work when I paste into Notepad or into the program I need to paste it into. Figures.

What I'm pasting into is a (I think) VB-based questionnaire which then loads the text into a (I think) COBOL-based display program.
Reply With Quote
  #8  
Old 09-05-2007, 03:51 PM
Mbossa Mbossa is offline
Guest
 
Join Date: Aug 2003
CHAR(13) is a carriage return and CHAR(10) is a line feed. The correct one to use depends on your operating system. In Windows, you use a carriage return AND a line feed together (Linux uses CR by itself and MacOS uses LF by itself).

So try something like

Code:
=concatenate(A23,CHAR(13),CHAR(10),B23,CHAR(13),CHAR(10),C23)
It's likely that Word automatically detects and converts newlines from other operating systems, but Notepad and your program obviously don't.
Reply With Quote
  #9  
Old 09-05-2007, 04:00 PM
The Great Sun Jester The Great Sun Jester is offline
Guest
 
Join Date: Mar 2004
***Plants a big sloppy kiss on Mbossa's teeth***

That did the trick!
Reply With Quote
  #10  
Old 09-05-2007, 07:43 PM
Mangetout Mangetout is offline
Charter Member
 
Join Date: May 2001
Location: Kingdom of Butter
Posts: 47,666
Quote:
Originally Posted by Inigo Montoya
Interesting result there, Mr. Omnivore, and that may yet come in handy. But what I'm looking for is a character that can be concatenated between two strings that will induce a carriage return when the result is pasted into notepad/word document, etc.
Ah... I didn't realise that when you said concatenate, you really meant it.

Quote:
What I'm pasting into is a (I think) VB-based questionnaire which then loads the text into a (I think) COBOL-based display program.
Oh, you have one of those jobs too, I see.
Reply With Quote
  #11  
Old 09-05-2007, 08:30 PM
The Great Sun Jester The Great Sun Jester is offline
Guest
 
Join Date: Mar 2004
Quote:
Originally Posted by Mangetout
Ah... I didn't realise that when you said concatenate, you really meant it.

Oh, you have one of those jobs too, I see.
Heh...largest personal lines insurance claims operation in North America. Software cobbled together since the mid-70s and massaged elevnty-one different ways to keep pace with the legal environments for 50 states and chunks of Canada. We have software that nobody knows the origins of doing things that nobody understands for departments nobody's really sure exist anymore. There have been suggestions that we scrap the old 'warez and develop a totally modern & compatable-without-translator-programs environment that would allow underwriting, service, claims and agency to operate together seamlessly. But nobody ever listens to me.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:52 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Send questions for Cecil Adams to: cecil@chicagoreader.com

Send comments about this website to: webmaster@straightdope.com

Terms of Use / Privacy Policy

Advertise on the Straight Dope!
(Your direct line to thousands of the smartest, hippest people on the planet, plus a few total dipsticks.)

Publishers - interested in subscribing to the Straight Dope?
Write to: sdsubscriptions@chicagoreader.com.

Copyright © 2013 Sun-Times Media, LLC.