ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting a Sheet (https://www.excelbanter.com/excel-programming/272798-deleting-sheet.html)

Abdul Salam

Deleting a Sheet
 
If you Protect the workbook sheet delete will be disabled

ToolsProtectionProtect Workbook

Abdul Salam

-----Original Message-----
Hi,

I am currently using the Sheet_Deactivate event to check

if a user
try's to delete a sheet. Is there anyway to cancel the

actual sheet
deletion after the user has selected Delete on the Excel

message box
that is displayed when deleting any sheet? Basically

what I am trying
to do is stop users deleting a sheet if it has

particular information
on it?

Any ideas?

Thanks in advance..

Rick
.


Rick De Marco

Deleting a Sheet
 
Thanks Abdul, but I need to allow the user to delete the sheet if it
does not contain certain information (which I can catch in my code).
Basically I need to catch the deleting in an event and then determine if
they are allowed to delete it or not. If not, then I need to display a
message and stop them from deleting. Displaying the message if fine, but
how to I stop the actual deletion of the sheet once they have selected
delete on the Excel message box? Can this be done?

Thanks, Rick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 03:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com