I am making an order form in excel that i would like to be reasonably secure (i realise that excel is always relatively insecure to someone who wants to crack it but 99% of my users will not have desire or ability to unlock passwords or VBA). I have used data validation, hidden sheets with picklist information, i have locked cells, protected sheets and protected the workbook which is a good start. However what i would like help with is the ability to stop users from copying cells from another workbook and pasting them over the top of the data validation that exists in the "Item" column. I have found some VBA code online that appears to be on the right track but is giving me an error at the moment. Can someone please help edit this code and or provide some new code to solve my problem. If there are any other suggestions with regard to making this document more secure then i would be interested to know them so i can learn and apply these methods again.
The code is
Private Sub Worksheet_Change(ByVal Target As Range)
'Does the validation range still have validation?
MsgBox "Your last operation failed." & _
"It would have deleted approved lists from the system.", vbCritical
Private Function HasValidation(r) As Boolean
' Returns True if every cell in Range r uses Data Validation
On Error Resume Next
x = r.Validation.Type
If Err.Number = 0 Then HasValidation = True Else HasValidation = False