0
正在編寫一個程序來刪除所有月份名稱的工作表。但是程序後刪除片,它會給我一個自動化錯誤刪除導致自動化錯誤的工作表
Sub DelSheet()
Dim i As Integer
Dim months() As String
months() = Split("January February March April May June July Auguest September October November December")
Dim ws As Worksheet
Application.DisplayAlerts = False
For Each ws In Worksheets
For i = 0 To UBound(months)
If ws.Name = months(i) Then
ws.Delete
End If
Next i
Next ws
Application.DisplayAlerts = True
End Sub
難道說以後我刪除表,當它開始下一個循環中集(表)的元素已更改。
對於每個WS在工作表中
我迷路