|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub bb()
- Dim brr(8)
- r = Range("b" & Rows.Count).End(xlUp).Row
- arr = Range("a1:a" & r)
- ji = 0
- brr(0) = 2 '起始行
- For i = brr(0) To UBound(arr, 1)
- jis = Rows(i).OutlineLevel
- If jis < ji Then
- For j = jis + 1 To 8
- If brr(j) > 0 Then brr(j) = 0 Else Exit For
- Next
- End If
- ji = jis
- brr(jis) = brr(jis) + 1
- arr(i, 1) = ""
- For j = 1 To jis
- arr(i, 1) = arr(i, 1) & "." & brr(j)
- Next
- arr(i, 1) = Mid(arr(i, 1), 2)
-
-
- Next
- Range("a1:a" & r) = arr
- End Sub
复制代码 |
|