Something like concatenation

davey11372

Board Regular
Joined
Dec 19, 2009
Messages
56
I have a list of stock symbols (many hundreds) indexed in row A:A of an Excel worksheet, eg:

AQT
BSI
CMXO
DOD
ESTA


I need to merge the list into one cell with a comma (without any space) between the tickers, eg.

AQT,BSI,CMXO,DOD,ESTA

Any help would be appreciated.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Try this - result in B1

Code:
Sub concat()
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("B1").Value = Join(Application.Transpose(Range("A1:A" & LR)), ",")
End Sub
 
Upvote 0
Say your list starts in A1...

- In B1 enter =A1
- In B2 enter =B1&","&A2
- Copy B2 down

The entry at the bottom of your copied list will be all the items joined.

Dom
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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