View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jock Jock is offline
external usenet poster
 
Posts: 440
Default Stop users deleting& inserting rows

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
--
Traa Dy Liooar

Jock


"Eduardo" wrote:

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

"Jock" wrote:

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.
--
Traa Dy Liooar

Jock