我想删除名称以“data as at”开头的表格。我使用了以下但没有工作。
For Each SheetExists In Worksheets
If Left(SheetExists.Name, 10) = "Data as at" Then
Application.DisplayAlerts = False
Sheets(Left("Data as at", 10)).Delete
Application.DisplayAlerts = True
Exit For
End If
Next SheetExists
它返回以下行的下标错误。
Sheets(Left("Data as at", 10)).Delete
答案 0 :(得分:3)
Sheets(Left("Data as at", 10)).Delete
SheetExists.Delete