Excel将列转换为逗号分隔

时间:2014-02-19 18:30:31

标签: excel

在Excel中,我有一个有50行的列。现在我想将这50行转换为具有逗号分隔值的单个单元格。有办法吗?

2 个答案:

答案 0 :(得分:0)

试试用户定义的功能

Public Function conkat(rIn As Range) As String
    conkat = ""
    For Each r In rIn
        conkat = conkat & "," & r.Value
    Next r
    conkat = Mid(conkat, 2)
End Function

用过:

= conkat(A1:A50)

答案 1 :(得分:0)

如果您具有Office 365 Excel,则可以使用TEXTJOIN():

=TEXTJOIN(",",TRUE,A1:A50)