Hi All,
I need a script that will delete sheets based on an earlier calculation. TabDiff2 is defined earlier.
I have the following code which is breaking:
For v = TabDiff2 To 1 Step -1
Sheets("2_Weightings").Index -v.Select
Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
Next v
Is there a problem with selecting sheets using their index dynamically?
How else could I do this?
Thanksfor any help,
Shabangle
I need a script that will delete sheets based on an earlier calculation. TabDiff2 is defined earlier.
I have the following code which is breaking:
For v = TabDiff2 To 1 Step -1
Sheets("2_Weightings").Index -v.Select
Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
Next v
Is there a problem with selecting sheets using their index dynamically?
How else could I do this?
Thanksfor any help,
Shabangle