|
Sub 导出()
Dim Items, strPath$, wkb As Workbook, sht As Worksheet
strPath = ThisWorkbook.Path & "\"
With Application.FileDialog(1)
With .Filters
.Clear
.Add "Excel Files", "*.xls*"
End With
.AllowMultiSelect = False
.InitialFileName = strPath
If .Show Then Set Items = .SelectedItems Else Exit Sub
End With
Application.ScreenUpdating = False
Set wkb = Workbooks.Open(Items(1), 0)
With wkb
For Each sht In ThisWorkbook.Sheets
If sht.Name <> "目录" And sht.Name <> "理表" Then
sht.Copy after:=.Sheets(.Sheets.Count)
End If
Next sht
wkb.Close True
End With
Set wkb = Nothing
Set sht = Nothing
Application.ScreenUpdating = True
Beep
End Sub |
|