EXCEL求个批量删除工作簿中Q1="请删除此表"的工作表的VBA。
发布网友
发布时间:2024-10-23 22:40
我来回答
共4个回答
热心网友
时间:2024-10-31 17:06
Sub 删除()
For Each sh In Sheets
If sh.Range("Q1") = "请删除此表" Then sh.Delete
Next
End Sub
热心网友
时间:2024-10-31 17:09
Sub 删表()
Dim i As Worksheet
Application.DisplayAlerts = False #避免出现提示“确认删除”
For Each i In Worksheets
If i.Range("Q1").Text = "请删除此表" Then i.Delete
Next
Application.DisplayAlerts = True
End Sub
热心网友
时间:2024-10-31 17:13
Sub sc()
Dim sh As Worksheet
Application.DisplayAlerts = False
For Each sh In Worksheets
If sh.Range("q1") = "请删除此表" Then sh.Delete
Next
Application.DisplayAlerts = True
End Sub
热心网友
时间:2024-10-31 17:11
Sub eraseSheet()
Dim i!, Alert As Boolean
Alert = Application.DisplayAlerts
Application.DisplayAlerts = False
For i = Sheets.Count To 1 Step -1
If Sheets(i).Range("Q1") = "请删除此表" Then Sheets(i).Delete
Next
Application.DisplayAlerts = Alert
End Sub