Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Everybody,
Need help again !! I need a macro to delete active worksheets without a specific worksheet name eg: Sheet7, Sheet8 & Sheet9, etc. I had tried this statement but it don't work.. Is there anyone can help me ?? Activesheet.Delete Thank You Very Much !!! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why and how doesn't it work?
-- __________________________________ HTH Bob "Delight" wrote in message ... Hello Everybody, Need help again !! I need a macro to delete active worksheets without a specific worksheet name eg: Sheet7, Sheet8 & Sheet9, etc. I had tried this statement but it don't work.. Is there anyone can help me ?? Activesheet.Delete Thank You Very Much !!! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub JustKillMe()
Application.DisplayAlerts = False ActiveSheet.Delete Application.DisplayAlerts = True End Sub -- Gary''s Student - gsnu200814 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Everybody,
Thanks for the help !! Simon, I followed your method and I get what I want. Thanks !! "Gary''s Student" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to copy a workbook and delete a specific worksheet | Excel Programming | |||
Macro to delete specific cells | Excel Programming | |||
Macro to delete specific rows | Excel Programming | |||
How to delete worksheet with specific criteria | Excel Programming | |||
Macro to delete specific rows | Excel Programming |