Colleen45
Active Member
- Joined
- Jul 22, 2007
- Messages
- 495
Hi There
I have a worksheet that i would like to protect because of complex formulas
in this work sheet i have some VBA Code as follows:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column = 1 Or Target.Column = 18 Then
If Target.Value > 0 Then
Target.Offset(0, 2).Value = Date
Else
Target.Offset(0, 2).Value = ""
End If
End If
End Sub
And it works perfectly well
However when i protect the worksheet it produces an error as follows:
Runtime Error '1004'
Application Defined or Object-defined error
And yet as soon as the sheet protection is removed, it all works fine again.
How do i get around this.
Regards
I have a worksheet that i would like to protect because of complex formulas
in this work sheet i have some VBA Code as follows:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column = 1 Or Target.Column = 18 Then
If Target.Value > 0 Then
Target.Offset(0, 2).Value = Date
Else
Target.Offset(0, 2).Value = ""
End If
End If
End Sub
And it works perfectly well
However when i protect the worksheet it produces an error as follows:
Runtime Error '1004'
Application Defined or Object-defined error
And yet as soon as the sheet protection is removed, it all works fine again.
How do i get around this.
Regards