Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Delete hidden worksheets

Hi

What code can be used to delete all hidden worksheets?

Thanks

Sham
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Delete hidden worksheets

Hi
try
Sub delete_hidden()
Dim wkSht As Worksheet
For Each wkSht In ActiveWorkbook.Worksheets
If wkSht.Visible < True Then
wkSht.Delete
End If
Next wkSht
End Sub

this will delete all sheets that are not visible (xlSheetHidden and
xlSheetVeryHidden)


--
Regards
Frank Kabel
Frankfurt, Germany

Shamsul Islam wrote:
Hi

What code can be used to delete all hidden worksheets?

Thanks

Sham


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Delete hidden worksheets

Sub DeleteHidden()
Dim sh As Worksheet
Application.DisplayAlerts = False
For Each sh In ActiveWorkbook.Worksheets
If sh.Visible = xlHidden Or sh.Visible = xlVeryHidden Then
sh.Delete
End If
Next sh
Application.DisplayAlerts = True
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Shamsul Islam" wrote in message
...
Hi

What code can be used to delete all hidden worksheets?

Thanks

Sham



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Hidden Named Range Scott Excel Discussion (Misc queries) 3 July 24th 08 09:40 PM
How do I delete hidden records/rows? Melissa M Excel Discussion (Misc queries) 2 June 8th 07 06:27 PM
Delete hidden cells brownti Excel Discussion (Misc queries) 2 February 6th 07 09:34 PM
How do I detect hidden worksheets or hidden data on a worksheet? Alice Excel Discussion (Misc queries) 4 August 24th 06 03:38 AM
How do I delete hidden character in Excel? Isa Excel Discussion (Misc queries) 3 November 15th 05 04:29 PM


All times are GMT +1. The time now is 02:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"