Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Multiple address lines in an 'if'

I want to insert an address into a merged cell depending on a location cell.
When I use the code below, Excel does not recognize the <alt enter. Any
ideas?

=IF(E2=1,"ABC Company<alt enter123 Street<alt enterAnytown, State
Zip","DEF Company<alt enter456 Road<alt enterAnytown, State Zip")

The <alt enter does not work in this text box, but I think you will
understand what I want to do.

Thanks for any help.
Learner101b
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Multiple address lines in an 'if'

Use this.

=IF(E2=1,"ABC Company" & CHAR(10) & "123 Street" & CHAR(10) & "Anytown,
StateZip","DEF Company" & CHAR(10) & "456 Road" & CHAR(10) & "Anytown, State
Zip")

You need to check the "wrap text" box in the cell alignment format.
--
Yanick


"Learner101b" wrote:

I want to insert an address into a merged cell depending on a location cell.
When I use the code below, Excel does not recognize the <alt enter. Any
ideas?

=IF(E2=1,"ABC Company<alt enter123 Street<alt enterAnytown, State
Zip","DEF Company<alt enter456 Road<alt enterAnytown, State Zip")

The <alt enter does not work in this text box, but I think you will
understand what I want to do.

Thanks for any help.
Learner101b

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Multiple address lines in an 'if'

Works like a charm. Thank you very much.

Curiosity question:
How did you know a 'return' was 'char' 10?

Learner010b

"Yanick" wrote:

Use this.

=IF(E2=1,"ABC Company" & CHAR(10) & "123 Street" & CHAR(10) & "Anytown,
StateZip","DEF Company" & CHAR(10) & "456 Road" & CHAR(10) & "Anytown, State
Zip")

You need to check the "wrap text" box in the cell alignment format.
--
Yanick


"Learner101b" wrote:

I want to insert an address into a merged cell depending on a location cell.
When I use the code below, Excel does not recognize the <alt enter. Any
ideas?

=IF(E2=1,"ABC Company<alt enter123 Street<alt enterAnytown, State
Zip","DEF Company<alt enter456 Road<alt enterAnytown, State Zip")

The <alt enter does not work in this text box, but I think you will
understand what I want to do.

Thanks for any help.
Learner101b

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Multiple address lines in an 'if'

I knew it for my C++ programming in DOS. ASCII code for line feed is 10.

Take a look there to have a list of all code
http://www.asciitable.com/

I am sure you can have a lot of info on google if you search for ASCII.

Have fun!
--
Yanick


"Learner101b" wrote:

Works like a charm. Thank you very much.

Curiosity question:
How did you know a 'return' was 'char' 10?

Learner010b

"Yanick" wrote:

Use this.

=IF(E2=1,"ABC Company" & CHAR(10) & "123 Street" & CHAR(10) & "Anytown,
StateZip","DEF Company" & CHAR(10) & "456 Road" & CHAR(10) & "Anytown, State
Zip")

You need to check the "wrap text" box in the cell alignment format.
--
Yanick


"Learner101b" wrote:

I want to insert an address into a merged cell depending on a location cell.
When I use the code below, Excel does not recognize the <alt enter. Any
ideas?

=IF(E2=1,"ABC Company<alt enter123 Street<alt enterAnytown, State
Zip","DEF Company<alt enter456 Road<alt enterAnytown, State Zip")

The <alt enter does not work in this text box, but I think you will
understand what I want to do.

Thanks for any help.
Learner101b

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Multiple address lines in an 'if'

Thank you for all of you help!
.. . . Learner101b

"Yanick" wrote:

I knew it for my C++ programming in DOS. ASCII code for line feed is 10.

Take a look there to have a list of all code
http://www.asciitable.com/

I am sure you can have a lot of info on google if you search for ASCII.

Have fun!
--
Yanick


"Learner101b" wrote:

Works like a charm. Thank you very much.

Curiosity question:
How did you know a 'return' was 'char' 10?

Learner010b

"Yanick" wrote:

Use this.

=IF(E2=1,"ABC Company" & CHAR(10) & "123 Street" & CHAR(10) & "Anytown,
StateZip","DEF Company" & CHAR(10) & "456 Road" & CHAR(10) & "Anytown, State
Zip")

You need to check the "wrap text" box in the cell alignment format.
--
Yanick


"Learner101b" wrote:

I want to insert an address into a merged cell depending on a location cell.
When I use the code below, Excel does not recognize the <alt enter. Any
ideas?

=IF(E2=1,"ABC Company<alt enter123 Street<alt enterAnytown, State
Zip","DEF Company<alt enter456 Road<alt enterAnytown, State Zip")

The <alt enter does not work in this text box, but I think you will
understand what I want to do.

Thanks for any help.
Learner101b



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Multiple address lines in an 'if'

And you really used alt-enter instead of this literal <alt-enter, right?

Did you remember to turn on wraptext?

Format|Cells|Alignment tab|check Wrap Text
(xl2003 menus)

And remember that merged cells don't react nicely to autofitting the rowheight.
You'll have to adjust that manually.

Learner101b wrote:

I want to insert an address into a merged cell depending on a location cell.
When I use the code below, Excel does not recognize the <alt enter. Any
ideas?

=IF(E2=1,"ABC Company<alt enter123 Street<alt enterAnytown, State
Zip","DEF Company<alt enter456 Road<alt enterAnytown, State Zip")

The <alt enter does not work in this text box, but I think you will
understand what I want to do.

Thanks for any help.
Learner101b


--

Dave Peterson
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
How do I place 3 lines of text (an address) in 1 cell? Mark New Users to Excel 2 October 25th 06 12:46 AM
display 1 line of multiple worksheets into multiple lines on 1 wks Golf Nut Excel Worksheet Functions 1 October 5th 06 08:28 AM
Splitting comma separated lines of an address for mail merge. Chuda Excel Discussion (Misc queries) 1 September 12th 06 01:04 PM
Display multiple lines of text within a cell from multiple column. Zeeshan Zaheer Excel Worksheet Functions 3 August 23rd 06 10:08 AM
?? Extra blank lines in 'address' cell after exporting to Excel Hadyn Pkok Excel Discussion (Misc queries) 4 April 15th 05 11:34 PM


All times are GMT +1. The time now is 05:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"