Consulting

Results 1 to 3 of 3

Thread: Prevent Worksheet Deletion

  1. #1

    Prevent Worksheet Deletion

    Hi,

    I am in need of stopping users deleting a worksheet. There appears to be no delete event to trap and I don’t want to protect the workbook as I still need the users to be able to use it.

    It is part of an automated system and sheets must be deleted in a specific way for the automation to hang together properly but it must still allow the users to enter specific data on the sheets; it’s that I need be able to limit some functions they may try to do.

    Anyone have any relevant code?

    Thanks

  2. #2
    VBAX Tutor
    Joined
    Sep 2007
    Posts
    265
    Location
    you can disable delete sheet button in command bar

    [VBA]CommandBars("Worksheet menu bar").Controls("Edit").Controls("Delete Sheet").Enabled = False[/VBA]

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,443
    Location
    Could you not just protect the workbook?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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