Sub 批量删除数据()
ipath = ThisWorkbook.Path & "\"
myFile = Dir(ipath & "*.xls*")
Application.ScreenUpdating = False
Do While myFile <> ""
If myFile <> ThisWorkbook.Name Then
Workbooks.Open ipath & myFile
表名 = ActiveWorkbook.Sheets("Sheet1").Range("A2")
区域 = ActiveWorkbook.Sheets("Sheet1").Range("B2")
ActiveWorkbook.Sheets(表名).Range(区域).Clear
ActiveWorkbook.Close True
End If
myFile = Dir
Loop
Application.ScreenUpdating = True
End Sub
Sub demo()
Application.ScreenUpdating = False
Path = ThisWorkbook.Path & "\"
file = Dir(Path & "*.xls")
sh = [a2]: Rng = [b2]
Do While file <> ""
If file <> ThisWorkbook.Name Then
Workbooks.Open Path & file
Sheets(sh).Range(Rng).Clear
ActiveWorkbook.Close 1
End If
file = Dir
Loop
End Sub
Sub demo()
Application.ScreenUpdating = False
Path = ThisWorkbook.Path & "\"
file = Dir(Path & "*.xls")
sh = [a2]: Rng = [b2]
Do While file <> ""
If file <> ThisWorkbook.Name Then
Workbooks.Open Path & file
Sheets(sh).Range(Rng).Clear
ActiveWorkbook.Close 1
End If
file = Dir
Loop
End Sub
Sub Åúá¿é¾3yêy¾Y()
ipath = ThisWorkbook.Path & "\"
myFile = Dir(ipath & "*.xls*")
Application.ScreenUpdating = False
表名 = ActiveWorkbook.Sheets("Sheet1").Range("A2")
区域 = ActiveWorkbook.Sheets("Sheet1").Range("B2")
Do While myFile <> ""
If myFile <> ThisWorkbook.Name Then
Workbooks.Open ipath & myFile
ActiveWorkbook.Sheets(表名).Range(区域).ClearContents
ActiveWorkbook.Close True
End If
myFile = Dir
Loop
Application.ScreenUpdating = True
End Sub