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


I have a workbook that has almost 600 tabs, but only about 200 have data
that I need.

Can anyone help me write a macro that check the value of a certain
cell, say W300, and deletes each worsheet where it equals zero?

thanks


--
rbanks
------------------------------------------------------------------------
rbanks's Profile: http://www.excelforum.com/member.php...fo&userid=2944
View this thread: http://www.excelforum.com/showthread...hreadid=521753

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to delete worksheets


Hi, just off the top of my head this is what I got:


Code:
--------------------

Public Sub Main()
For i = 1 To Sheets.Count
If TypeName(Sheets(i)) = "Worksheet" Then
Sheets(i).Activate
If ActiveSheet.Cells(Y, X).Value = "" Then
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
End If
End If
Next
End Sub

--------------------


Not tried the code, perhaps someone else knows a better way?


--
gti_jobert
------------------------------------------------------------------------
gti_jobert's Profile: http://www.excelforum.com/member.php...o&userid=30634
View this thread: http://www.excelforum.com/showthread...hreadid=521753

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
Speed Up A Macro / Delete Worksheets [email protected] Excel Programming 1 September 19th 05 05:53 PM
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 1 June 22nd 05 01:12 AM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 PM
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 0 June 21st 05 04:38 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:20 PM


All times are GMT +1. The time now is 01:57 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"