+ Reply to Thread
Results 1 to 5 of 5

SheetBeforeDelete event

  1. #1
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    920

    SheetBeforeDelete event

    How can I set cancel = ture in this event?
    I want to prevent user from deleting sheet without protecting the sheet

    This code shows errors
    Please Login or Register  to view this content.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,260

    Re: SheetBeforeDelete event

    There is no Cancel argument for that event. You can't just add one.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,032

    Re: SheetBeforeDelete event

    I want to prevent user from deleting sheet without protecting the sheet
    Not sure I understand why you'd need to protect the sheet in order to allow it to be deleted.

    However, in some cases you can work around the lack of Cancel by copying the sheet prior to the delete going ahead.

    Please Login or Register  to view this content.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,404

    Re: SheetBeforeDelete event

    Not sure I understand why you'd need to protect the sheet in order to allow it to be deleted.
    I didn't read it that way: I believe the OP wants to stop anyone from deleting the sheet without having to use sheet protection himself.

    EDIT: Thread has been marked as solved, though.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,032

    Re: SheetBeforeDelete event

    Oh yes, that makes more sense.

+ 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. [SOLVED] Formula to return the longest stretch of days from one event to the next event
    By jolthof in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-02-2021, 10:01 PM
  2. [SOLVED] Ho w to prevent Activate event running a Change event
    By Yoepy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-06-2019, 02:25 AM
  3. Replies: 2
    Last Post: 11-11-2017, 04:49 AM
  4. [SOLVED] Using .SetFocus inside a TextBox_Exit event causes _Exit event to fire twice.
    By Fattyfatfat Kid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2015, 07:21 PM
  5. Replies: 4
    Last Post: 07-18-2015, 04:28 AM
  6. [SOLVED] Userform multipage control - exit event not firing or event order
    By jane serky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-14-2013, 10:23 AM
  7. Replies: 4
    Last Post: 11-07-2012, 04:02 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