PDA

View Full Version : Prevent Worksheet Deletion



cosmarchy
07-01-2010, 12:48 AM
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

slamet Harto
07-01-2010, 01:31 AM
you can disable delete sheet button in command bar

CommandBars("Worksheet menu bar").Controls("Edit").Controls("Delete Sheet").Enabled = False

Bob Phillips
07-01-2010, 01:39 AM
Could you not just protect the workbook?