|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub test()
- ar = [a1].CurrentRegion
- ReDim arr(1 To UBound(ar), 1 To 3)
- For i = 1 To UBound(ar)
- If Len(ar(i, 1)) Then
- n = n + 1
- arr(n, 3) = arr(n, 3) & ar(i, 2)
- ElseIf ar(i, 1) = "" And Len(ar(i, 2)) Then
- arr(n, 3) = arr(n, 3) & ar(i, 2)
- End If
- Next i
- [a1].Resize(n, 3) = arr
- End Sub
- Sub test()
- ar = [a1].CurrentRegion
- ReDim arr(1 To UBound(ar), 1 To 3)
- For i = 1 To UBound(ar)
- If Len(ar(i, 1)) Then
- n = n + 1
- arr(n, 3) = arr(n, 3) & ar(i, 2)
- ElseIf ar(i, 1) = "" And Len(ar(i, 2)) Then
- arr(n, 3) = arr(n, 3) & ar(i, 2)
- End If
- Next i
- [a1].Resize(n, 3) = arr
- End Sub
复制代码 |
|