View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Deleting All Sheets Other than specified from a workbook

Hi nic
one way: try

Public Sub delete_sheets()
Dim wkSht As Worksheet
Application.DisplayAlerts = False
For Each wkSht In Worksheets
If wkSht.Name < "process sheet" Then
wkSht.Delete
End If
Next wkSht
Application.DisplayAlerts = True
End Sub

Frank

Hello :)

I run a vba script to populate and format another workbook with data.

I would like to add to this script a clever bit of code to remove all
sheets other that a set sheet

i.e remove all sheets except 'process sheet'

unfortunatly 'process sheet' is not the active sheet so I cannot use

a
script I already know :(

Any help would be marvelous


All the best

Nic


---
Message posted from http://www.ExcelForum.com/