Merging cells to copy and paste, without using mailmerge

dyanblak

New Member
Joined
Apr 18, 2014
Messages
17
Office Version
  1. 2016
Platform
  1. Windows
Hi , I wonder if anybody can help?
I need to prepare a table that merges names and addresses into one cell so that it can be copied and pasted onto eg a label.
Unable to use mailmerge as not all users are familiar will this so want to keep it simple.
Ideally I would like a formula to use in column I. At the moment I have copied and pasted each cell and entered alt with enter to get the next row, which is obviously time-consuming
Any advice greatly appreciated. Spoof names and addresses used here:
Sign Up DateCustomer NameAddress 1Address 2Address 3Address 4Address 5PostcodeTo copy and paste into corres, labels etc
19/03/2014John Smith56 Tower HouseWandsworth LaneLambethLondonSW6 5ETJohn Smith
56 Tower House
Wandsworth Lane
London
SW6 5ET
08/04/2014Cheryl Jones3 Kings RoadRamsgateKentCH11 6LN
07/05/2014Valerie Patisserie14 Hill RiseHaprendenHertfordshireAT5 4SN
12/05/2014David Evans27 Bell RoadRetfordNottinghamDN21 5PF
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
To create een ALT+ENTER you can use: CHAR(10) (Works only when wrap text is active)
=A2&CHAR(10)&B2
 
Upvote 0
you can try Power Query (Get&Transform)
Sign Up DateCustomer NameAddress 1Address 2Address 3Address 4Address 5PostcodeCustom
19/03/2014John Smith56 Tower HouseWandsworth LaneLambethLondonSW6 5ETJohn Smith 56 Tower House Wandsworth Lane Lambeth London SW6 5ET
08/04/2014Cheryl Jones3 Kings RoadRamsgateKentCH11 6LNCheryl Jones 3 Kings Road Ramsgate Kent CH11 6LN
07/05/2014Valerie Patisserie14 Hill RiseHaprendenHertfordshireAT5 4SNValerie Patisserie 14 Hill Rise Haprenden Hertfordshire AT5 4SN
12/05/2014David Evans27 Bell RoadRetfordNottinghamDN21 5PFDavid Evans 27 Bell Road Retford Nottingham DN21 5PF

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table16"]}[Content],
    UOC = Table.UnpivotOtherColumns(Source, {"Sign Up Date"}, "Attribute", "Value"),
    Group = Table.Group(UOC, {"Sign Up Date"}, {{"Count", each _, type table}}),
    List = Table.AddColumn(Group, "Custom", each [Count][Value]),
    Extract = Table.TransformColumns(List, {"Custom", each Text.Combine(List.Transform(_, Text.From), "#(lf)"), type text}),
    TSC = Table.SelectColumns(Extract,{"Custom"})
in
    TSC
after all you will need to use Wrap Text on result column
 
Upvote 0
Another option using a UDF
VBA Code:
Function dyanblak(rng As Range) As String
   Dim x as Variant
   
   x = Filter(Evaluate("index(if(" & rng.Address & "="""",false," & rng.Address & "),1,0)"), False, False)
   dyanblak = Join(x, vbLf)
End Function
+Fluff v2.xlsm
ABCDEFGHI
1Sign Up DateCustomer NameAddress 1Address 2Address 3Address 4Address 5PostcodeTo copy and paste into corres, labels etc
219/03/2014John Smith56 Tower HouseWandsworth LaneLambethLondonSW6 5ETJohn Smith 56 Tower House Wandsworth Lane Lambeth London SW6 5ET
308/04/2014Cheryl Jones3 Kings RoadRamsgateKentCH11 6LNCheryl Jones 3 Kings Road Ramsgate Kent CH11 6LN
407/05/2014Valerie Patisserie14 Hill RiseHaprendenHertfordshireAT5 4SNValerie Patisserie 14 Hill Rise Haprenden Hertfordshire AT5 4SN
512/05/2014David Evans27 Bell RoadRetfordNottinghamDN21 5PFDavid Evans 27 Bell Road Retford Nottingham DN21 5PF
Main
Cell Formulas
RangeFormula
I2:I5I2=dyanblak(B2:H2)
 
Upvote 0
To create een ALT+ENTER you can use: CHAR(10) (Works only when wrap text is active)
=A2&CHAR(10)&B2
I LOVE this simple fix! Thank you so much (y)
Without seeming ungrateful, is there a way to get rid of the spaces at appear when there is no text in the cell being merged eg Address 5 on first entry. Happy to use it anyway, if the spaces have to stay.
I am getting:
John Smith
56 Tower House
Wandsworth Lane
Lambeth
London

SW6 5ET
 
Upvote 0
you can try Power Query (Get&Transform)
Sign Up DateCustomer NameAddress 1Address 2Address 3Address 4Address 5PostcodeCustom
19/03/2014John Smith56 Tower HouseWandsworth LaneLambethLondonSW6 5ETJohn Smith 56 Tower House Wandsworth Lane Lambeth London SW6 5ET
08/04/2014Cheryl Jones3 Kings RoadRamsgateKentCH11 6LNCheryl Jones 3 Kings Road Ramsgate Kent CH11 6LN
07/05/2014Valerie Patisserie14 Hill RiseHaprendenHertfordshireAT5 4SNValerie Patisserie 14 Hill Rise Haprenden Hertfordshire AT5 4SN
12/05/2014David Evans27 Bell RoadRetfordNottinghamDN21 5PFDavid Evans 27 Bell Road Retford Nottingham DN21 5PF

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table16"]}[Content],
    UOC = Table.UnpivotOtherColumns(Source, {"Sign Up Date"}, "Attribute", "Value"),
    Group = Table.Group(UOC, {"Sign Up Date"}, {{"Count", each _, type table}}),
    List = Table.AddColumn(Group, "Custom", each [Count][Value]),
    Extract = Table.TransformColumns(List, {"Custom", each Text.Combine(List.Transform(_, Text.From), "#(lf)"), type text}),
    TSC = Table.SelectColumns(Extract,{"Custom"})
in
    TSC
after all you will need to use Wrap Text on result column
Thanks for this - the result looks perfect but I am after the simplest possible way to do it and am favouring Mart 37s way at the moment, although it does create unwanted line spaces.
I am not very au fait with Power Queries etc and have up to 10 address per customer to amalgamate, so a formula would work best for me.
Thank you so much for you input though - very impressed.
 
Upvote 0
Another option using a UDF
VBA Code:
Function dyanblak(rng As Range) As String
   Dim x as Variant
  
   x = Filter(Evaluate("index(if(" & rng.Address & "="""",false," & rng.Address & "),1,0)"), False, False)
   dyanblak = Join(x, vbLf)
End Function
+Fluff v2.xlsm
ABCDEFGHI
1Sign Up DateCustomer NameAddress 1Address 2Address 3Address 4Address 5PostcodeTo copy and paste into corres, labels etc
219/03/2014John Smith56 Tower HouseWandsworth LaneLambethLondonSW6 5ETJohn Smith 56 Tower House Wandsworth Lane Lambeth London SW6 5ET
308/04/2014Cheryl Jones3 Kings RoadRamsgateKentCH11 6LNCheryl Jones 3 Kings Road Ramsgate Kent CH11 6LN
407/05/2014Valerie Patisserie14 Hill RiseHaprendenHertfordshireAT5 4SNValerie Patisserie 14 Hill Rise Haprenden Hertfordshire AT5 4SN
512/05/2014David Evans27 Bell RoadRetfordNottinghamDN21 5PFDavid Evans 27 Bell Road Retford Nottingham DN21 5PF
Main
Cell Formulas
RangeFormula
I2:I5I2=dyanblak(B2:H2)
Thanks for this - the result looks perfect but I am after the simplest possible way to do it and am favouring Mart 37s way at the moment, although it does create unwanted line spaces.
I am not very au fait with Power Queries etc and have up to 10 address per customer to amalgamate, so a formula would work best for me.
Thank you so much for you input though - very impressed.
 
Upvote 0
As you are using 2016 you don't have the textjoin function, so to do it like mart37 showed, you would need multiple ifs along the lines of
Excel Formula:
=B2&IF(C2="","",CHAR(10)&C2)&IF(D2="","",CHAR(10)&D2)
 
Upvote 0
As you are using 2016 you don't have the textjoin function, so to do it like mart37 showed, you would need multiple ifs along the lines of
Excel Formula:
=B2&IF(C2="","",CHAR(10)&C2)&IF(D2="","",CHAR(10)&D2)
PERFECT! (y)
 
Upvote 0

Forum statistics

Threads
1,215,379
Messages
6,124,610
Members
449,174
Latest member
ExcelfromGermany

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