Hello, could you help with this please?
I have code that copies cells A5:D8 and inserts them below. And also have a code that deletes wanted rows, it asks me which row do I wanna delete etc. BUT some people just dont' understand and sometimes they delete those A5:D8 rows also, and then whole workbook is ruined. Is it possible to protect these cells A5:D8 so that they are still able to be copied but users cannot delete them??
this is the code that deletes rows
Sub delete()
ActiveSheet.Unprotect
Dim a As Long, response As Long
a = Application.InputBox( _
Prompt:="Row-number", _
Title:="Delete row:", Type:=1)
If a <> False Then
response = MsgBox("Are u sure u wanna delete row", vbYesNo)
If response = vbYes Then Rows(a).Delete
End If
ActiveSheet.Protect
End Sub
Bookmarks