Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need a function for a macro that allows me to delete all tabs that have a
$0.00 value in the cell C2? What code can I use to do this. I created a button, is there a better option (such as a way to generate it on open spreadsheet) ? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub DeleteSheets()
for each sh in Worksheets if sh.range("C2").Value = 0 then Application.DisplayAlerts = False sh.Delete end if Next Application.DisplayAlerts = True end Sub Turn on the macro recorder and place a button from the forms toolbar on the sheet, then assign this macro to it. Turn off the macro recorder and you have your code. You would probably call it from the workbook_Open event http://www.cpearson.com/excel/events.htm -- Regards, Tom Ogilvy "dogpigfish" wrote in message ... I need a function for a macro that allows me to delete all tabs that have a $0.00 value in the cell C2? What code can I use to do this. I created a button, is there a better option (such as a way to generate it on open spreadsheet) ? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2002: Can I delete tabs at one go ? | Excel Discussion (Misc queries) | |||
Not a novice - can't delete tabs! | Excel Discussion (Misc queries) | |||
tabs are missing even though 'tools-options-view-sheet tabs' ok? | Excel Worksheet Functions | |||
How can I find and delete tabs and carriage returns ? | Excel Discussion (Misc queries) | |||
Macro to force delete tabs | Excel Programming |