Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Combining Cell Contents (Part 2)

Hello,

Thank you for your previous reply, it was great.

One more variable than I didn't think about, if cell B2 is empty how can I
make sure that only A2 is populated and that I don't have a blank line on the
bottom?

Example:

A2 = 109 Vine Hill & B2 = (Empty)

Result:
109 Vine Hill

NOT:
109 Vine Hill
(Empty Line)

Thank you.

Sincerely,

PaolaAndrea
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Combining Cell Contents (Part 2)

Check the other suggestions at your original post.

PaolaAndrea wrote:

Hello,

Thank you for your previous reply, it was great.

One more variable than I didn't think about, if cell B2 is empty how can I
make sure that only A2 is populated and that I don't have a blank line on the
bottom?

Example:

A2 = 109 Vine Hill & B2 = (Empty)

Result:
109 Vine Hill

NOT:
109 Vine Hill
(Empty Line)

Thank you.

Sincerely,

PaolaAndrea


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Combining Cell Contents (Part 2)

First, it's good to respond in the same thread.

Second, since you had multiple responses, you'll want to share the formula you
used--and what happened when you tried it.

Dave Peterson wrote:

Check the other suggestions at your original post.

PaolaAndrea wrote:

Hello,

Thank you for your previous reply, it was great.

One more variable than I didn't think about, if cell B2 is empty how can I
make sure that only A2 is populated and that I don't have a blank line on the
bottom?

Example:

A2 = 109 Vine Hill & B2 = (Empty)

Result:
109 Vine Hill

NOT:
109 Vine Hill
(Empty Line)

Thank you.

Sincerely,

PaolaAndrea


--

Dave Peterson


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Combining Cell Contents (Part 2)

Use this UDF

Function ConCatRange(CellBlock As Range) As String
Dim Cell As Range
Dim sbuf As String
For Each Cell In CellBlock
If Len(Cell.text) 0 Then sbuf = sbuf & Cell.text & Chr(10)
Next
ConCatRange = Left(sbuf, Len(sbuf) - 1)
End Function

If any cell is blank, no extra linefeed is entered.

=ConCatRange(A2:F2) or whatever range you choose.


Gord Dibben MS Excel MVP


On Fri, 9 May 2008 09:42:00 -0700, PaolaAndrea
wrote:

Hello,

Thank you for your previous reply, it was great.

One more variable than I didn't think about, if cell B2 is empty how can I
make sure that only A2 is populated and that I don't have a blank line on the
bottom?

Example:

A2 = 109 Vine Hill & B2 = (Empty)

Result:
109 Vine Hill

NOT:
109 Vine Hill
(Empty Line)

Thank you.

Sincerely,

PaolaAndrea


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
Combining Cell Contents PaolaAndrea Excel Discussion (Misc queries) 5 May 9th 08 05:38 PM
Combining Cell Contents Storm Excel Worksheet Functions 4 April 14th 07 04:42 AM
Combining Cell Contents - entire columns SV Excel Worksheet Functions 7 December 11th 06 11:30 PM
Combining cell contents when there is content to combine Richard Excel Discussion (Misc queries) 2 June 21st 06 07:30 PM
Can I use cell contents as part of a formula? Brian Rhodes Excel Worksheet Functions 3 June 3rd 05 05:00 PM


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