Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to 'delete' all my worksheets after performing some operations on
the data, The following code does NOT work sucessfully apparently due to the fact that deleting all worksheets ends the Workbook, ! (error message) Sub killWorksheets() Dim W As Worksheet For Each W In Worksheets Worksheets(W.Name).Delete Next End Sub Any tips most welcome, thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You must leave at least one worksheet in a workbook.
If you don't want the workbook, why not just close it without saving it Activeworkbook.Close SaveChanges:=False -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "portroe" wrote in message ... I want to 'delete' all my worksheets after performing some operations on the data, The following code does NOT work sucessfully apparently due to the fact that deleting all worksheets ends the Workbook, ! (error message) Sub killWorksheets() Dim W As Worksheet For Each W In Worksheets Worksheets(W.Name).Delete Next End Sub Any tips most welcome, thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
yep i guess that makes sense
thanks Bob Phillips wrote: You must leave at least one worksheet in a workbook. If you don't want the workbook, why not just close it without saving it Activeworkbook.Close SaveChanges:=False |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to kill an ActiveX object | Excel Discussion (Misc queries) | |||
Kill Macro | Excel Discussion (Misc queries) | |||
On time kill | Excel Discussion (Misc queries) | |||
AutoFill KILL | Excel Programming | |||
how to kill excel using a vbscript | Excel Programming |