Sub aa()
Dim myPath$, myFile$, AK As
Workbook, aRow%, tRow%, i As Integer
Application.ScreenUpdating =
False
'凍結屏幕,以防屏幕抖動
myPath = ThisWorkbook.Path
&
"\"
'把文件路徑定義給變量
myFile = Dir(myPath &
"*.xls")
'依次找尋指定路徑中的*.xls文件
Do While myFile <>
""
'當指定路徑中有文件時進行循環
If myFile <> ThisWorkbook.Name Then
Set AK = Workbooks.Open(myPath &
myFile)
'打開符合要求的文件
Range("a:a,d:f,h:i,n:o,q:s,x:y").Delete
Workbooks(myFile).Close
True
'關閉源工作簿,並不作修改
End If
myFile =
Dir
'找尋下一個*.xls文件
Loop
Application.ScreenUpdating =
True
'凍結屏幕,此類語句一般成對使用
MsgBox "刪除完成,請查看!", 64,
"提示"
End Sub