Function JoinText(Rng As Range, Optional Txt As String = ",") As String
Dim c As Range
For Each c In Rng
JoinText = JoinText & c.Value & Txt
Next c
JoinText = Left(JoinText, Len(JoinText) - 1)
End Function
或者
Function JoinText(Rng As Range, Optional Txt As Variant) As String
Dim c As Range
If IsMissing(Txt) Then Txt = ","
For Each c In Rng
JoinText = JoinText & c.Value & Txt
Next c
JoinText = Left(JoinText, Len(JoinText) - 1)
End Function
上一篇:excel宏教程:向未打开的工作簿中输入数 下一篇:表格制作快速入门:用Array函数创建数组并写入单元格
郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。