|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub test0()
- Dim ar, br(), cr
- Dim i, j, p, x, y
- Columns("I:K").Clear
- ar = Range("A1").CurrentRegion.Value
- ReDim br(1 To UBound(ar), 1 To 3)
- br(1, 1) = ar(1, 1)
- br(1, 3) = ar(1, 2)
- For j = 3 To UBound(ar, 2)
- y = 1
- br(1, 2) = ar(1, j)
- cr = Array(1, j, 2)
- For i = 2 To UBound(ar)
- If Len(ar(i, j)) Then
- y = y + 1
- For x = 0 To UBound(cr)
- br(y, x + 1) = ar(i, cr(x))
- Next
- End If
- Next
- With Cells(p + 1, "I").Resize(y, UBound(br, 2))
- .Columns(3).NumberFormatLocal = "@"
- .HorizontalAlignment = xlCenter
- .Value = br
- End With
- p = p + y + 1
- Next
- End Sub
复制代码 |
评分
-
2
查看全部评分
-
|