Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Speed Up A Macro / Delete Worksheets | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming |