|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
参与一下。。。
- Sub ykcbf() '//2024.6.18
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- arr = Sheets("明细表").UsedRange
- For i = 1 To UBound(arr)
- If InStr(arr(i, 1), "揽投岗位计件工资核算表") Then k = k + 1: d(k) = i
- Next
- ReDim brr(1 To UBound(arr), 1 To 100)
- On Error Resume Next
- t = d.items
- For k = 1 To d.Count
- r1 = d(k)
- If k = d.Count Then r2 = r Else r2 = d(k + 1) - 1
- c = 0
- m = m + 1
- For i = r1 To r2
- For x = 1 To 9
- c = c + 1
- brr(m, c) = arr(i + 5, x)
- Next
- For x = 4 To 11
- c = c + 1
- brr(m, c) = arr(i + 8, x)
- Next
- For x = 4 To 9
- c = c + 1
- brr(m, c) = arr(i + 11, x)
- Next
- For x = 4 To 9
- c = c + 1
- brr(m, c) = arr(i + 14, x)
- Next
- '**************************
- For x = 12 To 20
- c = c + 1
- brr(m, c) = arr(i + 5, x)
- Next
- For x = 13 To 20
- c = c + 1
- brr(m, c) = arr(i + 8, x)
- Next
- For x = 13 To 20
- c = c + 1
- brr(m, c) = arr(i + 11, x)
- Next
- For x = 13 To 20
- c = c + 1
- brr(m, c) = arr(i + 14, x)
- Next
- Next
- Next
- With Sheets("汇总")
- .UsedRange.Offset(3).Clear
- With .[a4].Resize(m, 62)
- .Value = brr
- .Borders.LineStyle = 1
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- End With
- ActiveWindow.DisplayZeros = False
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|