Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A2K
Using code, how do I loop through all the worksheets in a workbook and delete all but the first one, "Sheet1" Thanks, Charles D Clayton Jr |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try
Sub deleteallsheets() Application.DisplayAlerts = False For Each ws In Worksheets If ws.Name < "Sheet1" Then ws.Delete Next Application.DisplayAlerts = True End Sub -- Don Guillett SalesAid Software "cdclayton" wrote in message ups.com... A2K Using code, how do I loop through all the worksheets in a workbook and delete all but the first one, "Sheet1" Thanks, Charles D Clayton Jr |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your help. One more question, is it possible to have this
work no matter what the sheet is renamed to? Thanks, Charles D Clayton Jr |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try
Sub deleteallsheets() Application.DisplayAlerts = False For Each ws In Worksheets If ws.Index < 1 Then ws.Delete Next Application.DisplayAlerts = True End Sub -- Don Guillett SalesAid Software "cdclayton" wrote in message oups.com... Thanks for your help. One more question, is it possible to have this work no matter what the sheet is renamed to? Thanks, Charles D Clayton Jr |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete ROW on Sheet#1 corupts data on Sheet#2 | Excel Worksheet Functions | |||
Delete values in sheet 2 that arre found in sheet 1 | Excel Discussion (Misc queries) | |||
Delete rows from one sheet containing deatils on the second sheet | New Users to Excel | |||
How to Delete a Range in Closed Workbook (to Replace Delete Query) | Excel Discussion (Misc queries) | |||
Automatically Delete WorkBook 2 modules by using Workbook 1 module | Excel Programming |