+ Reply to Thread
Results 1 to 2 of 2

Delete Tabs

Hybrid View

  1. #1
    dogpigfish
    Guest

    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. #2
    Tom Ogilvy
    Guest

    Re: 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" <dogpigfish@discussions.microsoft.com> wrote in message
    news:65ACE759-8A18-493F-8CC6-240795F15402@microsoft.com...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1