|
- '*********************************
- '******* 北极狐工作室出品 ******
- '******* QQ:14885553 ******
- '*********************************
- Sub Opiona()
- '禁止系统刷屏?触发其他事件等
- 'On Error Resume Next '// 发生错误,自动执行下一句,就是忽略错误
- Application.ScreenUpdating = False '//关闭屏幕刷新
- Application.DisplayAlerts = False '//关闭系统提示
- Application.EnableEvents = False '//禁止触发其他事件
- t = Timer '//开始时间
- Set SH0 = Sheets("汇总")
- SH0.Range("A2:Z65536").ClearContents
- FileArr = FileAllArr(ThisWorkbook.Path & "", "*.xls?", ThisWorkbook.Name, False)
- For I = 0 To UBound(FileArr)
-
- Set WB = Workbooks.Open(FileArr(I)) '//打开工作簿
- Set NSH1 = WB.Sheets("正面")
- Set NSH2 = WB.Sheets("反面")
- SH0.Cells(I + 2, 1) = NSH1.Cells(2, 3)
- SH0.Cells(I + 2, 2) = NSH1.Cells(2, 7)
- SH0.Cells(I + 2, 3) = NSH1.Cells(2, 17)
- SH0.Cells(I + 2, 4) = NSH1.Cells(4, 3)
- SH0.Cells(I + 2, 5) = NSH1.Cells(4, 7)
- SH0.Cells(I + 2, 6) = NSH1.Cells(4, 17)
- SH0.Cells(I + 2, 7) = NSH1.Cells(5, 3)
- SH0.Cells(I + 2, 8) = NSH1.Cells(5, 7)
- SH0.Cells(I + 2, 9) = NSH1.Cells(5, 17)
- SH0.Cells(I + 2, 10) = NSH1.Cells(6, 3)
- SH0.Cells(I + 2, 11) = NSH1.Cells(6, 12)
- SH0.Cells(I + 2, 12) = NSH2.Cells(2, 4)
- SH0.Cells(I + 2, 13) = NSH2.Cells(3, 4)
- SH0.Cells(I + 2, 13) = NSH2.Cells(5, 4)
- WB.Close False
- Next
- Application.EnableEvents = True '// '//恢复触发其他事件
- Application.ScreenUpdating = True '//恢复屏幕刷新
- Application.DisplayAlerts = True '//恢复系统提示
- MsgBox "一共用时:" & Format(Timer - t, "#0.0000") & " 秒", , "北极狐提示!!" '//提示所用时间
- End Sub
复制代码 |
|