Skip i'r prif gynnwys

Sut i drosi rhestr colofnau i restr coma wedi'i gwahanu yn Excel?

Os ydych chi am drosi rhestr golofn o ddata i restr sydd wedi'i gwahanu gan atalnod neu wahanyddion eraill, ac allbwn y canlyniad i mewn i gell fel y dangosir isod, gallwch chi ei gyflawni trwy swyddogaeth CONCATENATE neu redeg VBA yn Excel.


Trosi rhestr colofnau i restr wedi'i gwahanu gan goma gyda swyddogaeth TEXTJOIN

Mae swyddogaeth Excel TEXTJOIN yn ymuno â nifer o werthoedd o res, colofn neu ystod o gelloedd â amffinydd penodol.

Sylwch mai dim ond yn Excel ar gyfer Office 365, Excel 2021, ac Excel 2019 y mae'r swyddogaeth ar gael.

I drosi rhestr colofnau i restr wedi'i gwahanu gan goma, dewiswch gell wag, er enghraifft, y gell C1, a theipiwch y fformiwla hon =TEXTJOIN(", ",TRUE,A1:A7) (A1: A7 yw'r golofn y byddwch yn ei throsi i restr danheddog coma, "" yn nodi sut rydych chi am wahanu'r rhestr). Gweler y sgrinlun isod:


Trosi rhestr golofnau i restr sydd wedi'i gwahanu â choma gyda swyddogaeth CONCATENATE

Yn Excel, gall swyddogaeth CONCATENATE drosi'r rhestr golofnau i restr mewn cell sydd wedi'i gwahanu gan atalnodau. Gwnewch fel a ganlyn:

1. Dewiswch gell wag wrth ymyl data cyntaf y rhestr, er enghraifft, y gell C1, a theipiwch y fformiwla hon = PRYDER (TROSGLWYDDO (A1: A7) & ",") (A1: A7 yw'r golofn y byddwch yn ei throsi i restr danheddog coma, "," yn nodi'r gwahanydd rydych chi am wahanu'r rhestr). Gweler sgrinluniau isod:

2. Tynnwch sylw at y TROSGLWYDDO (A1: A7) & "," yn y fformiwla, a gwasgwch y F9 allweddol.

3. Tynnwch y braces cyrliog {ac } o'r fformiwla, a gwasgwch y Rhowch allweddol.

Nawr, gallwch weld bod yr holl werthoedd yn y rhestr golofnau wedi cael eu trosi rhestr mewn cell a'u gwahanu gan atalnod. Gweler y screenshot uchod.

Troswch restr colofn yn gyflym i restr wedi'i wahanu gan goma gyda Kutools ar gyfer Excel

Kutools ar gyfer Excel's Cyfuno Colofnau neu Rhesi heb Golli Data gall cyfleustodau helpu defnyddwyr Excel i gyfuno colofnau neu resi lluosog yn un colofnau / rhes yn hawdd heb golli data. Yn ogystal, gall defnyddwyr Excel lapio'r tannau testun cyfun hyn gyda cherbyd neu ddychwelyd caled.


Trosi rhestr golofnau i restr sydd wedi'i gwahanu â choma gyda VBA

Os yw'r swyddogaeth CONCATENATE ychydig yn ddiflas i chi, gallwch ddefnyddio VBA i drosi'r rhestr golofnau yn gyflym mewn rhestr mewn cell.

1. Daliwch ALT botwm a gwasgwch F11 ar y bysellfwrdd i agor a Microsoft Visual Basic ar gyfer Cymhwyso ffenestr.

2. Cliciwch Mewnosod > Modiwlau, a chopïwch y VBA i'r modiwl.

VBA: Trosi rhestr golofnau i restr gwahanu coma

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. Cliciwch Run botwm neu wasg F5 i redeg y VBA.

4. Deialog wedi'i arddangos ar y sgrin, a gallwch ddewis y rhestr golofnau rydych chi am ei throsi. Gweler y screenshot:

5. Cliciwch OK, yna daeth deialog arall i chi ddewis cell. Gweler y screenshot:

6. Cliciwch OK, ac mae'r holl werthoedd yn y rhestr golofnau wedi'u trosi'n rhestr sydd wedi'i gwahanu gan atalnod mewn cell.

Tip: Yn y VBA uchod, mae "," yn nodi'r gwahanydd sydd ei angen arnoch, a gallwch ei newid yn ôl yr angen.


Trosi rhestr golofn i restr gwahanu coma gyda Kutools ar gyfer Excel

Gallwch hefyd wneud cais Kutools ar gyfer Excel's Cyfunwch cyfleustodau i gyfuno rhestr golofnau, a gwahanu pob gwerth â choma yn hawdd.

Kutools ar gyfer Excel - Supercharge Excel gyda dros 300 o offer hanfodol. Mwynhewch dreial 30 diwrnod llawn sylw AM DDIM heb fod angen cerdyn credyd! Get It Now

1. Dewiswch y rhestr golofnau y byddwch chi'n eu trosi i restr sydd wedi'i gwahanu gan goma, a chliciwch Kutools > Uno a Hollti> Cyfuno Rhesi, Colofnau neu Gelloedd heb Golli Data.

2. Yn y blwch deialog Cyfuno Colofnau neu Rhesi agoriadol, mae angen i chi:
(1) Gwiriwch y Cyfuno rhesi opsiwn yn y Cyfuno celloedd dethol yn ôl yr opsiynau canlynol adran;
(2) Yn y Nodwch wahanydd adran, edrychwch ar y Gwahanydd arall opsiwn, a theipiwch goma , i'r blwch canlynol;

3. Cliciwch y Ok botwm.

Nawr fe welwch fod yr holl werthoedd yn y rhestr golofnau benodol yn cael eu cyfuno i mewn i un gell a'u trosi'n rhestr sydd wedi'i gwahanu gan goma.

Kutools ar gyfer Excel - Supercharge Excel gyda dros 300 o offer hanfodol. Mwynhewch dreial 30 diwrnod llawn sylw AM DDIM heb fod angen cerdyn credyd! Get It Now


Demo: trosi rhestr colofnau i restr coma wedi'i gwahanu yn Excel


Kutools ar gyfer Excel: Dros 300 o offer defnyddiol ar flaenau eich bysedd! Dechreuwch eich treial am ddim 30 diwrnod heb unrhyw gyfyngiadau nodwedd heddiw. Lawrlwytho Nawr!

Gwrthdroi concatenate a throsi un gell (rhestr danheddog coma) i restr rhes / colofn yn Excel

Fel rheol gall defnyddwyr Excel gymhwyso'r Testun i Colofnau nodwedd i rannu un gell i golofnau lluosog, ond nid oes dull uniongyrchol i drosi un gell yn rhesi lluosog. Fodd bynnag, Kutools ar gyfer Excel's Celloedd Hollt gall cyfleustodau eich helpu i'w gyflawni'n hawdd fel y dangosir isod y llun.



Erthyglau Perthynas:

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