回答編集履歴
1
インデックス値の修正
answer
CHANGED
@@ -24,13 +24,13 @@
|
|
24
24
|
Dim i, wcnt, idx As Integer
|
25
25
|
Application.DisplayAlerts = False
|
26
26
|
wcnt = Worksheets.Count 'ワークシート数
|
27
|
-
i =
|
27
|
+
i = 7 '処理を行うシートのインデックス'
|
28
28
|
Do While i <= wcnt
|
29
29
|
Set ws = Sheets(i) 'インデックス番号からシートオブジェクト取得
|
30
30
|
ws.Activate '任意のシートをアクティブにする
|
31
31
|
If 判定式 Then
|
32
32
|
ActiveSheet.Delete
|
33
|
-
wcnt = wcnt - 1 '削除した場合は
|
33
|
+
wcnt = wcnt - 1 '削除した場合は上限ワークシート数を減らしておくこと
|
34
34
|
End If
|
35
35
|
i = i + 1
|
36
36
|
Loop
|