Hi All
Is there any method to prevent Insertion of a new worksheet or Deletion of an existing worksheet in a Workbook.
Any help shall be well received.
Thanx/r_mundhra
Hi All
Is there any method to prevent Insertion of a new worksheet or Deletion of an existing worksheet in a Workbook.
Any help shall be well received.
Thanx/r_mundhra
For insert, you could trap the NewSheet event and just delete it again.
Delete is not easy, there is no event to piggy-back onto.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
By protectiting the WB(Tools\Protect\Protect Workbook), insertion/deletion of Wsheet can be done.
Thanx Sujit for the info...I tried to generate the VBA code with the help of the Macro Recorder. I had put in a password also in the WB(Tools\Protect\Protect Workbook) pop up window. But the Macro (generated from recorded) does not show any password.
Any help on this ...???
Thanx/RM
[VBA]Sub DoProtect()
ActiveWorkbook.Protect "password"
End Sub
Sub UnProtect()
ActiveWorkbook.UnProtect "password"
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'