|
- Sub 按钮20_Click()
- Set fso = CreateObject("scripting.filesystemobject")
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- pth = ThisWorkbook.Path & "\资管"
- arr = Array("工作量", "经纬度")
- If Not fso.folderexists(pth) Then
- MkDir pth
- End If
- For Each f In fso.getfolder(ThisWorkbook.Path).Files
- If InStr(f.Name, "批量处理宏代码") = 0 Then
- With Workbooks.Open(f)
- .Unprotect "92101"
- .Sheets(arr).Copy
- With ActiveWorkbook
- .Sheets("工作量").Unprotect
- .Sheets("工作量").UsedRange.Value = .Sheets("工作量").UsedRange.Value
- .SaveAs Filename:=pth & .Sheets("工作量").[a3] & ".xls", FileFormat:=xlExcel8
- .Close False
- End With
- .Close False
- End With
- End If
- Next f
- Application.DisplayAlerts = True
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|