|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
参与一下。。。- Sub ykcbf() '//2024.3.14
- Dim zrr(1 To 1000)
- Application.ScreenUpdating = False
- Sheets("File").Activate
- r = Cells(Rows.Count, 3).End(3).Row
- arr = Range("c1:c" & r)
- ReDim brr(1 To UBound(arr), 0)
- On Error Resume Next
- n = 4
- For i = 4 To UBound(arr)
- If InStr(arr(i, 1), "小计") Then
- m = m + 1
- zrr(m) = Array(i, i)
- zrr(m)(1) = i
- End If
- If m = 1 Then
- zrr(m)(0) = n
- Else
- zrr(m)(0) = zrr(m - 1)(1) + 1
- End If
- If i = r Then zrr(m)(1) = r
- Next
- For x = 1 To m
- st = Replace(arr(zrr(x)(1), 1), "小计", "") & ":"
- For i = zrr(x)(0) To zrr(x)(1) - 1
- Cells(i, 3) = st & Cells(i, 3)
- Next
- Next
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|