+ Reply to Thread
Results 1 to 3 of 3

Delete worksheet if it is deactivated?

  1. #1
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Moscow
    MS-Off Ver
    Excel 2010
    Posts
    291

    Delete worksheet if it is deactivated?

    Hi all! Please help!

    I use exstensibility to create code in worksheet module. This code deleteS the worksheet if sheet is deactivated. Code works perfectly. BUT excel crushes. Which isn't suprising: this is code that cannot end since it deletes its own parent object - worksheet.

    Please any ideas how it can be accomplished? All i need is to delete a sheet if it is deactivated.

    Many thanks in advance!!!!
    Last edited by Alexander_Golinsky; 08-29-2013 at 11:06 AM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Delete worksheet if it is deactivated?

    Use the Workbook_SheetDeactivate event in the ThisWorkbook module?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Moscow
    MS-Off Ver
    Excel 2010
    Posts
    291

    Re: Delete worksheet if it is deactivated?

    WOW haven't know such a thing exists. Thank you !!!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Close Workbook,Rename Worksheet, Delete Worksheet.
    By Ariff_Chowdhury in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-24-2013, 09:21 PM
  2. Delete row in worksheet will delete row at same position in another Worksheet.
    By bhattacharjee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2013, 04:19 PM
  3. Code adjustment needed-warning message and highlighting is deactivated.
    By baffled1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-01-2011, 09:23 PM
  4. Create new worksheet by ticking checkbox and then delete worksheet by unchecking box
    By barefaced66 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 01-19-2011, 09:45 AM
  5. Worksheet_Deactivate procedure leaves me on the deactivated sheet
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2008, 05:21 PM

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