メインコンテンツへスキップ

Excelで列リストをカンマ区切りのリストに変換するにはどうすればよいですか?

データの列リストをコンマまたはその他の区切り文字で区切られたリストに変換し、その結果を次のようにセルに出力する場合は、CONCATENATE関数またはExcelでVBAを実行することで実行できます。


TEXTJOIN関数を使用して列リストをコンマ区切りリストに変換します

Excel TEXTJOIN関数は、行、列、またはセル範囲の複数の値を特定の区切り文字で結合します。

この関数は、Excel for Office 365、Excel 2021、およびExcel2019でのみ使用できることに注意してください。

列リストをカンマ区切りのリストに変換するには、セルC1などの空白のセルを選択し、次の数式を入力してください = TEXTJOIN( "、"、TRUE、A1:A7) (A1:A7 カンマ鋸歯状リストに変換する列です。 "" リストをどのように分離するかを示します)。 以下のスクリーンショットを参照してください。


CONCATENATE関数を使用して列リストをコンマ区切りリストに変換します

Excelでは、CONCATENATE関数は、列リストをコンマで区切られたセル内のリストに変換できます。 次のようにしてください。

1。 リストの最初のデータに隣接する空白のセル(セルC1など)を選択し、この数式を入力します = CONCATENATE(TRANSPOSE(A1:A7)& "、") (A1:A7 カンマ鋸歯状リストに変換する列です。 "、" リストを分離する区切り文字を示します)。 以下のスクリーンショットを参照してください。

2。 ハイライト TRANSPOSE(A1:A7)& "、" 数式で、を押します F9 キー。

3。 中括弧を削除します {& } 式から、を押します 入力します キー。

これで、列リストのすべての値がセル内のリストに変換され、コンマで区切られていることがわかります。 上記のスクリーンショットを参照してください。

Kutools for Excelを使用して、列リストをコンマ区切りのリストにすばやく変換する

Excel用のKutools データを失うことなく列または行を組み合わせる ユーティリティを使用すると、Excelユーザーは、データを失うことなく、複数の列または行をXNUMXつの列/行に簡単に組み合わせることができます。 さらに、Excelユーザーは、これらの結合されたテキスト文字列をキャリッジまたはハードリターンでラップできます。


VBAを使用して列リストをコンマ区切りリストに変換する

CONCATENATE関数が少し面倒な場合は、VBAを使用して、列リストをセル内のリストにすばやく変換できます。

1。 ホールド 頭の中 ボタンを押して F11 キーボードで開くには アプリケーション用 Microsoft Visual Basic 窓。

2に設定します。 OK をクリックします。 インセット > モジュール、VBAをモジュールにコピーします。

VBA:列リストをコンマ区切りリストに変換します

Sub ChangeRange()
'Updateby20140310
Dim rng As Range
Dim InputRng As Range, OutRng As Range
xTitleId = "KutoolsforExcel"
Set InputRng = Application.Selection
Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8)
Set OutRng = Application.InputBox("Out put to (single cell):", xTitleId, Type:=8)
outStr = ""
For Each rng In InputRng
    If outStr = "" Then
        outStr = rng.Value
    Else
        outStr = outStr & "," & rng.Value
    End If
Next
OutRng.Value = outStr
End Sub

3に設定します。 OK をクリックします。 ラン ボタンまたはプレス F5 VBAを実行します。

4。 画面に表示されるダイアログで、変換する列リストを選択できます。 スクリーンショットを参照してください:

5に設定します。 OK をクリックします。 OK、次に別のダイアログが表示され、セルを選択できます。 スクリーンショットを参照してください:

6に設定します。 OK をクリックします。 OK、および列リストのすべての値は、セル内でコンマで区切られたリストに変換されています。

先端:上記のVBAで、「、」は必要なセパレータを示しており、必要に応じて変更できます。


Kutools for Excelを使用して、列リストをコンマ区切りリストに変換します

また、Excel用のKutoolsを適用することもできます 組み合わせる 列リストを結合し、各値をコンマで簡単に区切るユーティリティ。

Kutools for Excel - 300 以上の必須ツールで Excel を強化します。 クレジット カードは必要なく、全機能を備えた 30 日間の無料トライアルをお楽しみください。 今すぐ入手

1。 カンマ区切りのリストに変換する列リストを選択し、をクリックします クツール > マージと分割>データを失うことなく行、列、またはセルを結合する.

2。 [列または行の結合]ダイアログボックスを開くには、次のことを行う必要があります。
(1)確認してください 行を組み合わせる 内のオプション 次のオプションに従って選択したセルを組み合わせるには セクション;
で(2) 区切り文字を指定します セクションで、 その他のセパレータ オプションを入力し、カンマを入力します , 次のボックスに;

3。 クリック Ok

これで、指定した列リストのすべての値がXNUMXつのセルに結合され、コンマ区切りのリストに変換されます。

Kutools for Excel - 300 以上の必須ツールで Excel を強化します。 クレジット カードは必要なく、全機能を備えた 30 日間の無料トライアルをお楽しみください。 今すぐ入手


デモ:Excelで列リストをコンマ区切りリストに変換する


Kutools for Excel: 300 を超える便利なツールをすぐに利用できます。 機能制限なしの 30 日間の無料トライアルを今すぐ始めてください。 今すぐダウンロード!

ExcelでXNUMXつのセル(コンマの鋸歯状のリスト)を行/列のリストに逆連結して変換します

通常、Excelユーザーは テキストから列へ XNUMXつのセルを複数の列に分割する機能がありますが、XNUMXつのセルを複数の行に直接変換する方法はありません。 ただし、Kutools for Excel 分割セル 以下のスクリーンショットに示すように、ユーティリティを使用すると、簡単に実行できます。



関連記事:

Comments (34)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
This comment was minimized by the moderator on the site
Hi Eric,
Thanks for you feedback. Since the TEXTJOIN is a rather new function, it was not there when we wrote the instruction. I will include the function in the article. Thanks so much.
Amanda
This comment was minimized by the moderator on the site
Major time saving technique - thank you!
This comment was minimized by the moderator on the site
Doesn't work, too many arguments in function.
This comment was minimized by the moderator on the site
This was a life saver! Thanks
This comment was minimized by the moderator on the site
Can someone help in converting a cell wish Value

Football, Baseball, Cricket

into


1. Football, 2. Baseball, 3. Cricket
This comment was minimized by the moderator on the site
Hi ADMINDIVISION,
You can use the Text to Columns (Excel built-in feature) or Split Cells (of Kutools for Excel) to split the cell to three columns or rows, and then apply the Insert Bullets or Numbering feature of Kutools for Excel to quickly insert numbering for the new cells/columns/rows.

Btw, there is an article introducing several solutions to inserting bullets or numberings into cells:https://www.extendoffice.com/documents/excel/950-excel-apply-bullets-numbering.html
This comment was minimized by the moderator on the site
I need to get my numbers to look like this ('1234567', '1234567') instead of ("1234567", "1234567") - any ideas!?
This comment was minimized by the moderator on the site
=SUBSTITUTE(value,CHAR(34),CHAR(39))
This comment was minimized by the moderator on the site
Hi,
There are no double quotas or quotas in the conversation results with any one of methods in this article.
This comment was minimized by the moderator on the site
Absolutely magic!Thanks!
This comment was minimized by the moderator on the site
Used This one: "Convert column list to comma separated list with VBA", worked perfect for converting rows (1000+) of email addresses into a combined list that my email client works well with. Just changed the "," to "; " and it was good to go. Thanks!
This comment was minimized by the moderator on the site
I would like to know how did you manage to copy the comma separated values from Excel Spreadsheet to Outlook/other main client. The reason being whenever I copy, the only formula gets copied but not the comma separated values. Please support.
This comment was minimized by the moderator on the site
Hi, Ravindran, you shold copy the formula result and the paste it into a cell as value firstly, then copy the pased value to other devices.
https://www.extendoffice.com/images/stories/comments/sun-comment/paste%20as%20value.png?1697765930000
This comment was minimized by the moderator on the site
Hi All, So for a few columns this formula is great, but if you were trying to figure this out on more cloumns more than 100. putting "&" is a waste of time. For me i needed sepration through "," (comma). for that, all you need to do is to separate the file in CSV, Open it on a Notepad, Copy and paste in in Word, then Copy again from Word and paste it on Excel. Hope you like to the suggested, Have a great day. Thank you, Mayank Bhargava
This comment was minimized by the moderator on the site
The VBA helped out so much! I am experiencing an issue if you try to close the pop up box or cancel it, it will show that the vba needs debugged. This also happens if the value is blank. Any ideas on how to fix this? Thanks!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations