|
试试看。在文件夹外新建个工作表。- Sub tt()
- On Error Resume Next
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Dim filename, shtname As String, wb As Workbook, Sht As Worksheet, fn As String, arr
- filename = Dir(ThisWorkbook.Path & "\新建文件夹\*.xls")
- Do While filename <> ""
- If filename <> ThisWorkbook.Name Then
- fn = ThisWorkbook.Path & "\新建文件夹" & filename
- Set wb = Workbooks.Open(fn)
- Set Sht = wb.Worksheets("人员信息表")
- Sht.Columns(22).Delete
- wb.Close True
- End If
- filename = Dir
- Loop
- Set Sht = Nothing
- Application.ScreenUpdating = True
- Application.DisplayAlerts = True
- End Sub
复制代码 |
|