|
参与一下。。。
- Sub ykcbf() '//2024.7.25
- Application.ScreenUpdating = False
- Set sh = ThisWorkbook.Sheets("汇总")
- ReDim brr(1 To 10000, 1 To 8)
- On Error Resume Next
- For Each sht In Sheets
- If sht.Name <> sh.Name Then
- n = n + 1
- With sht
- arr = .UsedRange
- If n = 1 Then
- m = m + 1
- For j = 1 To UBound(arr, 2)
- brr(m, j) = arr(1, j)
- Next
- brr(m, 8) = "客户"
- End If
- m = m + 1
- For j = 1 To UBound(arr, 2)
- brr(m, j) = arr(2, j)
- Next
- brr(m, 8) = .Name
- End With
- End If
- Next
- With sh
- .UsedRange.Offset(1).Clear
- With .[a1].Resize(m, 8)
- .Value = brr
- .Borders.LineStyle = 1
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- End With
- End With
- Application.ScreenUpdating = False
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|