Hello,

My macro creates (and names) and then deletes rather large number of worksheets in each iteration.

Recently I've noticed that although names are given properly (through a loop) the index is not zeroing but keep growing and growing.

I will add that the macro works just fine but I'm not sure it's healthy that the sheet's index getting so big (I assume so at least).

Any idea how to set the index to 0?

Here is the code that deletes each iteration active worksheets.


Option Explicit

Public Sub DeleteFilter()

Dim WS, L As Worksheet

Set L = ThisWorkbook.Worksheets("List")

Application.DisplayAlerts = False
    For Each WS In Sheets
    If WS.Name <> "LIN" And WS.Name <> "List" Then WS.Delete
    Next WS
Application.DisplayAlerts = True

End Sub