Combine two or more cells in Excel

saimanikumar

New Member
Joined
Apr 28, 2010
Messages
24
Hi,

I would like to combine 2 or more cells with a break-point.

For example if
A1= Apple
B1 = Boy
C1= (Empty cell)
D1= Dog

I want the text to show in my new cell as
Apple
Boy
Dog

Any suggestions will be helpful!

Thanks in advance.
Sam
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Code:
Sub b()
Set Rng = Range("A1:D1")
For Each Cell In Rng
  If Cell <> "" Then s = s & Cell & Chr(10)
Next
s = Left(s, Len(s) - 1)
Range("A2").Value = s
End Sub
 
Upvote 0
Hey Patel45,

Thank you so much for the reply. I am trying to write as a formula... here is what i found out so far
=CONCATENATE(B1,CHAR(10),C1,CHAR(10),D1) and then wrap the text
only problem with this is.. if there is an empty box i will get the output as

Apple
Boy

Dog

Any suggestions on how to remove the empty line??

Thanks again,
Saimani

Code:
Sub b()
Set Rng = Range("A1:D1")
For Each Cell In Rng
  If Cell <> "" Then s = s & Cell & Chr(10)
Next
s = Left(s, Len(s) - 1)
Range("A2").Value = s
End Sub
 
Upvote 0
=concatenate(
if(len(b1), b1 & char(10), ""),
if(len(c1), c1 & char(10), ""),
if(len(d1), d1 & char(10), ""))
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top