barring of inserting new worksheet

teayesbee

New Member
Joined
Jan 26, 2009
Messages
15
i have a protected worksheet (has formulas and formatted) to be distributed to 200 other users. after filling the data all the worksheets come back to me. i will merge all the worksheets and work with them. so i don't want others to insert a new worksheet copy formulas, formatting and messing it in the distributed worksheet. either disabling from inserting new worksheet for copying the contents of the protected worksheet in to new worksheet or encrypt this sheet not to copy in another workseet/workbook.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Here is how to accomplish what you say you want.

Find the little Excel workbook icon near the upper left corner of your workbook window, usually just to the immediate left of the File menu option. Right click on that icon, left click on View Code, and paste the following procedure into the large white area that is the workbook module:

Code:
Private Sub Workbook_NewSheet(ByVal Sh As Object)
Run "NoNewSheet"
End Sub

Next, while you are there in the Visual Basic Editor, from the menu bar at the top, click Insert > Module and paste this into that new module:

Code:
Private Sub NoNewSheet()
With Application
.ScreenUpdating = False
.DisplayAlerts = False
ActiveSheet.Delete
.DisplayAlerts = True
.ScreenUpdating = True
End With
MsgBox "No new worksheets are allowed to be added.", 48, "FYI..."
End Sub

Press Alt+Q to return to the worksheet.

Now when you attempt to insert a new worksheet, you'll get a message saying it cannot be done for that workook.
 
Last edited:
Upvote 0
As you said the two codes given by you were copied and pasted in respective places in view code as well as macro insert. but was unsuccessful. when i tried to insert a new worksheet, a new sheet was inserted. where i have done wrong??
 
Upvote 0

Forum statistics

Threads
1,215,011
Messages
6,122,677
Members
449,092
Latest member
tayo4dgacorbanget

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top