#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Delete Tabs

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Delete Tabs

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
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
Excel 2002: Can I delete tabs at one go ? Mr. Low Excel Discussion (Misc queries) 2 July 24th 09 05:16 PM
Not a novice - can't delete tabs! Sherri Excel Discussion (Misc queries) 1 April 9th 09 02:36 PM
tabs are missing even though 'tools-options-view-sheet tabs' ok? rgranell Excel Worksheet Functions 3 August 16th 08 04:25 PM
How can I find and delete tabs and carriage returns ? JeffEE Excel Discussion (Misc queries) 1 November 11th 05 02:47 PM
Macro to force delete tabs Randy[_11_] Excel Programming 1 August 13th 04 04:43 PM


All times are GMT +1. The time now is 06:58 PM.

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

About Us

"It's about Microsoft Excel"