TextJoin UDF For Excel 2013

前端 未结 4 2112
夕颜
夕颜 2020-12-18 13:17

I am trying to utilize a UDF version of TextJoin since I am using Excel 2013 - but this function is not properly returning the accurate data.

My data-set in Excel lo

4条回答
  •  长情又很酷
    2020-12-18 13:36

    Try this....!

    Function TEXTJOIN(delimiter As String, ignore_empty As Boolean, ParamArray 
    cell_ar() As Variant)
    2
    For Each cellrng In cell_ar
    3
    For Each cell In cellrng
    4
    If ignore_empty = False Then
    5
    result = result & cell & delimiter
    6
    Else
    7
    If cell <> "" Then
    8
    result = result & cell & delimiter
    9
    End If
    10
    End If
    11
    Next cell
    12
    Next cellrng
    13
    TEXTJOIN = Left(result, Len(result) - Len(delimiter))
    14
    End Function
    

提交回复
热议问题