Stop users deleting& inserting rows

J

Jock

A workbook is read only unless a password is entered to allow read/write for
managers only.
Once unlocked, the managers can add/change details as necessary.
I want to stop them from deleting and inserting rows thus forcing them to
add new data to the bottom of the existing data rather than inserting a row
randomly elsewhere.
Thanks.
 
E

Eduardo

Hi,
when you protect the sheet you can select from the list what the managers
can do in that way you don't need to provide them the password avoiding
people inserting or deleting rows
 
J

Jock

Using your method would apply to everyone accessing the workbook.
For everyone it is read only. The managers can read/write by inserting the
password upon opening the file. It is at this point I would like code to
ensure the managers cannot insert/remove rows. The following (found on this
forum, thanks to poster) will stop row deletion but I need something similar
to stop row insertion:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Name = "Product Catalogue" Then
If Target.Address = Target.EntireRow.Address Then
With Application
.EnableEvents = False
.Undo
msg = MsgBox("Deleting Rows Not Permitted", 16, "Warning")
.EnableEvents = True
End With
Else
Exit Sub
End If
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top