本文为《别怕,Excel VBA其实很简单(第3版)》随书问题参考答案

以下过程供参考:

Function JoinText(Txt As String, ParamArray list() As Variant) As String
Dim c As Variant, v As Variant
For Each c In list
If TypeName(c) = "Range" Or TypeName(c) = "Variant()" Then
For Each v In c
JoinText = JoinText & v & Txt
Next v
Else
JoinText = JoinText & c & Txt
End If
Next c
JoinText = Left(JoinText, Len(JoinText) - 1)
End Function

声明:本站所有文章均出自互联网,只为学习之用;如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。