ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Prevent Worksheet Deletions (https://www.excelbanter.com/excel-worksheet-functions/45027-prevent-worksheet-deletions.html)

Karen

Prevent Worksheet Deletions
 
Is there a way to prevent a user from deleting certain worksheets yet still
being able to insert new worksheets?

Thanks,
Karen........

Gord Dibben

Karen

Not without using VBA.

You would have the workbook protected to prevent deleting sheets.

Run a macro which would unprotect the workbook and add a given or chosen
number of sheets then reprotect the workbook.

Record a macro while you go through the above steps to add one sheet.

Will look something like this.

Sub Sheets_Add()
Dim i As Long
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect Password:="justme"
howmany = InputBox("Number of Sheets to insert")
For i = 1 To howmany
Sheets.Add
Next i
ActiveWorkbook.Protect Password:="justme", Structu=True
Application.ScreenUpdating = True
End Sub


Gord Dibben Excel MVP

On Mon, 12 Sep 2005 12:05:07 -0700, "Karen"
wrote:

Is there a way to prevent a user from deleting certain worksheets yet still
being able to insert new worksheets?

Thanks,
Karen........




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

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