Taking multiple rows and bringing them to one row VBA

burnsa9

New Member
Joined
Jul 20, 2017
Messages
11
I am trying to take multiple rows and bring them to one row. for example I am trying to take address, City, State, and country and bring them to one column that has them all read. I cant use a concatnation excel formula becasue I need there to be spaces between address city state and country. An example of what my data looks like is below along with what I want my output to looklike after running the VBA. I have tried running the excel formula = A2&B2&C2&D2 however this doesn't allow for approprate spacing. [TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Address
[/TD]
[TD]City
[/TD]
[TD]State
[/TD]
[TD]Counrty
[/TD]
[TD]Combined (Output I am looking for)
[/TD]
[/TR]
[TR]
[TD]240 new Byhalia Rd
[/TD]
[TD]Memphis
[/TD]
[TD]Tennessee
[/TD]
[TD]United States
[/TD]
[TD]240 new Byhalia Rd Memphis Tennesse
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
You can manually enter a space between each cell in the formula.

Try:


Excel 2013/2016
ABCDE
1AddressCityStateCounrtyCombined (Output I am looking for)
2240 new Byhalia RdMemphisTennesseeUnited States240 new Byhalia Rd Memphis Tennessee United States
Sheet2
Cell Formulas
RangeFormula
E2=A2&" "&B2&" "&C2&" "&D2
 
Upvote 0
You can also add spaces by sticking in =A1&" "&B1&" "&C1&" "&D1 or whre you looking for some other format?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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