copy a column - paste as a row with comma separated

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
I have these names in one column. I want to copy them and paste them a text file. but the way I want to paste them in text file is like this

5TLN1,WMLL1,MBUL1,FTLN1,WMLL1,9ZNM1,42FN1,..,...,...,...,

Is that possible? Thank you.



5TLN1
WMLL1
MBUL1
FTLN1
WMLL1
9ZNM1
42FN1
TCDP1
SSLN1
KNVL1
9BLN1
YXLN1

<colgroup><col width="64" style="width:48pt"> </colgroup><tbody>
</tbody>
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
If you do a Copy -> Paste Special -> Transpose, you can move it the structure of the data from a single column to a single row.
Then, if you save that as a CSV, you will have the data in a Text file in the format you desire.
 
Upvote 0
An alternative solution is to use Power Query. Here is the Mcode for such an action

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
    #"Transposed Table" = Table.Transpose(#"Changed Type"),
    #"Inserted Merged Column" = Table.AddColumn(#"Transposed Table", "Merged", each Text.Combine({[Column1], [Column2], [Column3], [Column4], [Column5], [Column6], [Column7], [Column8], [Column9], [Column10], [Column11], [Column12]}, ","), type text)
in
    #"Inserted Merged Column"

Click on the link in my signature to understand Power Query and Mcode.
 
Upvote 0

Forum statistics

Threads
1,213,552
Messages
6,114,278
Members
448,559
Latest member
MrPJ_Harper

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