View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Use macro to delete worksheet without specific name Eg:Sheet 1

Hi Simon;

That is an interesting interpretation of the question.
--
Gary''s Student - gsnu200814


"Simon Lloyd" wrote:


I think a much better version of the code would be:

Sub Del_Sheets()
Dim sh As Worksheet
Application.DisplayAlerts = False
For Each sh In Sheets
If Left(sh.Name, 5) = "Sheet" Then
sh.Delete
End If
Next
Application.DisplayAlerts = True
End Sub


--
Simon Lloyd

Regards,
Simon Lloyd
'www.thecodecage.com' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30854