ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protect individual worksheets from deletion (https://www.excelbanter.com/excel-programming/388546-protect-individual-worksheets-deletion.html)

ejm3

Protect individual worksheets from deletion
 
Using ThisWorkbook.Protect() protects the workbook structure from changing so
that no Worksheets can be added or deleted. I would like to protect certain
Worksheets from being deleted but not others. That is, I create some
Worksheets dynamically that I want users to be able to delete if necessary.
However, the five basic Worksheets need to be protected from deletion.

Is this possbile? If so, how.

Thanks,
John

Dave Peterson

Protect individual worksheets from deletion
 
Maybe you could give the users a dedicated macro that only delete the worksheets
that you want???

ejm3 wrote:

Using ThisWorkbook.Protect() protects the workbook structure from changing so
that no Worksheets can be added or deleted. I would like to protect certain
Worksheets from being deleted but not others. That is, I create some
Worksheets dynamically that I want users to be able to delete if necessary.
However, the five basic Worksheets need to be protected from deletion.

Is this possbile? If so, how.

Thanks,
John


--

Dave Peterson

Jim Cone

Protect individual worksheets from deletion
 
John,
A bit drastic, but might work for you...

In the Workbook_BeforeSave event, check for the existence of the five
sheets. It they are not all there then close the workbook without saving...

Cancel = True
This Workbook.Close SaveChanges:=False
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"ejm3"
wrote in message
Using ThisWorkbook.Protect() protects the workbook structure from changing so
that no Worksheets can be added or deleted. I would like to protect certain
Worksheets from being deleted but not others. That is, I create some
Worksheets dynamically that I want users to be able to delete if necessary.
However, the five basic Worksheets need to be protected from deletion.

Is this possbile? If so, how.

Thanks,
John

Wei Lu [MSFT]

Protect individual worksheets from deletion
 
Hi ,

How is everything going? Please feel free to let me know if you need any
assistance.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.



All times are GMT +1. The time now is 07:13 PM.

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