|
本帖最后由 huang1314wei 于 2015-6-26 07:22 编辑
- Sub 复制()
- Dim arr, i%, j%
- Application.ScreenUpdating = False
- arr = Range("A1:G" & Range("A1048576").End(3).Row)
- Workbooks.Open (ThisWorkbook.Path & "\表A.xlsx")
- j = ActiveWorkbook.Sheets(1).Range("A1048576").End(3).Row
- brr = ActiveWorkbook.Sheets(1).Range("A1:G" & j)
- Workbooks("表A.xlsx").Close False
- For i = 2 To UBound(arr)
- For m = 2 To UBound(brr)
- If arr(i, 1) <> "小计" And arr(i, 1) = brr(m, 1) Then
- For n = 2 To UBound(brr, 2)
- arr(i, n) = brr(m, n)
- Next
- End If
- Next
- Next
- Range("A1:G" & Range("A1048576").End(3).Row) = arr
- Application.ScreenUpdating = True
- MsgBox "复制完毕!"
- End Sub
复制代码
|
|