I'm trying to delete all sheets except the first sheet, but I get an
error 9 "subscript out of range" appears.
How can I fix it? Thanks in advance.
Dim Udalenie As Integer
If ThisWorkbook.Worksheets.Count > 1 Then
For Udalenie = 2 To ThisWorkbook.Worksheets.Count
ThisWorkbook.Sheets(Udalenie).Delete
Next Udalenie
End If