7,765
社区成员
发帖
与我相关
我的任务
分享
Sub CombArr()
Dim strTemp$
Dim i&, j&, p&
Dim lTeamWidth&, lGroupLen&
lTeamWidth = 26 '分组长度
lGroupLen = UBound(a)
i = LBound(a)
p = (lGroupLen - i + lTeamWidth) \ lTeamWidth
' 按数组下标从 0 开始
ReDim b(p - 1)
For p = 0 To p - 1
strTemp = ""
For j = 0 To lTeamWidth - 1
If ((j + i) > lGroupLen) Then Exit For
strTemp = strTemp & a(j + i)
Next
b(p) = strTemp
i = i + lTeamWidth
Next
End Sub
Dim a, b
a = Array( ........) '赋值代码自己写
b = Split(Replace(Join(a, ""), "ZA", "Z-A"), "-")
Dim a() As Variant
Dim b() As String 'b 要声明成 String
'或者:
'Dim b As Variant
'Dim b
a = Array( ........) '赋值代码自己写
b = Split(Replace(Join(a, ""), "ZA", "Z-A"), "-")