Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am trying to delete all sheets except 3 (one of which "admin" has got the names of the 2 other not to delete in cells that are named "name2" and "name2"). Here's my code but it is falling over. Any idea? Thanks Call UnprotectWorkbook Dim sh As Worksheet Application.DisplayAlerts = False For Each sh In ThisWorkbook.Worksheets If LCase(sh.Name) < "admin" And LCase(sh.Name) < Range("name1").Value And LCase(sh.Name) < Range ("name2").Value Then sh.Delete End If Next sh Application.DisplayAlerts = True |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro-delete all sheets except | Excel Discussion (Misc queries) | |||
Delete Sheets | Excel Programming | |||
Delete Sheets | Excel Programming | |||
Delete new sheets? | Excel Programming | |||
select and delete sheets | Excel Programming |