View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Delete Sheets to the left

Give this a try (I'd put it in a Module)...

Sub DeleteWorksheets()
Dim WS As Worksheet
Worksheets(1).Select
On Error GoTo Whoops
Application.DisplayAlerts = False
For Each WS In Worksheets
If WS.Index 2 Then WS.Delete
Next
Whoops:
Application.DisplayAlerts = True
End Sub

--
Rick (MVP - Excel)


"ian bartlett" wrote in message
news:HAWwk.153184$nD.64076@pd7urf1no...
Don

Chip is right it seems when I run your code I get the error
Run time error 9
Subscript out of range.

Any other ideas ??