Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tom:
a few pages back you helped me with this macro to clean several sheet by calling a macro called ClearSheet. Sub CleanAllSheets() For Each sh In ActiveWorkbook.Worksheets sh.Activate ClearSheet Next End Sub I have a sheet in the workbook that is protected and the macro fail when it gets to it. How can I run it on all sheets except on a shee called FORM? thanks a million.. -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this...
Sub CleanAllSheets() For Each sh In ActiveWorkbook.Worksheets if sh.name < "FORM" then sh.Activate ClearSheet End if Next End Sub "halem2 " wrote: Hi Tom: a few pages back you helped me with this macro to clean several sheets by calling a macro called ClearSheet. Sub CleanAllSheets() For Each sh In ActiveWorkbook.Worksheets sh.Activate ClearSheet Next End Sub I have a sheet in the workbook that is protected and the macro fails when it gets to it. How can I run it on all sheets except on a sheet called FORM? thanks a million... --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would suggest a slight revision to make it case insensitive
Sub CleanAllSheets() Dim sh as Worksheet For Each sh In ActiveWorkbook.Worksheets if Ucase(sh.name) < "FORM" then sh.Activate ClearSheet End if Next End Sub -- Regards, Tom Ogilvy "Jim Thomlinson" wrote in message ... Try this... Sub CleanAllSheets() For Each sh In ActiveWorkbook.Worksheets if sh.name < "FORM" then sh.Activate ClearSheet End if Next End Sub "halem2 " wrote: Hi Tom: a few pages back you helped me with this macro to clean several sheets by calling a macro called ClearSheet. Sub CleanAllSheets() For Each sh In ActiveWorkbook.Worksheets sh.Activate ClearSheet Next End Sub I have a sheet in the workbook that is protected and the macro fails when it gets to it. How can I run it on all sheets except on a sheet called FORM? thanks a million... --- Message posted from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Thank You Tom Ogilvy | Excel Worksheet Functions | |||
Tom Ogilvy | Excel Programming | |||
Tom Ogilvy | Excel Programming | |||
Tom Ogilvy | Excel Programming | |||
Help Tom Ogilvy | Excel Programming |