J
Josh
I am trying to make my excel sheet automatically give off the date and time
when some data is inputted into the cells next to it. I managed to do this
with this code but wanted to add the security that the person signing off is
actually authentic. I tried to insert your code into my previous code and it
kept giving me "Method "Value" of Object "Range" failed". Do you have any
suggestions?
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo EndItAll
Application.EnableEvents = False
If Target.Cells.Column = 5 Or Target.Cells.Column = 8 Or
Target.Cells.Column = 11 Then
ActiveSheet.Unprotect Password:="justme"
For Each cell In Target
If cell.Value <> "" Then
With cell.Offset(0, 1)
.Value = Now
.Locked = True
End With
End If
Next
End If
EndItAll:
Application.EnableEvents = True
'ActiveSheet.Protect Password:="justme"
Range("e2").Value = Environ("UserName")
End Sub
when some data is inputted into the cells next to it. I managed to do this
with this code but wanted to add the security that the person signing off is
actually authentic. I tried to insert your code into my previous code and it
kept giving me "Method "Value" of Object "Range" failed". Do you have any
suggestions?
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo EndItAll
Application.EnableEvents = False
If Target.Cells.Column = 5 Or Target.Cells.Column = 8 Or
Target.Cells.Column = 11 Then
ActiveSheet.Unprotect Password:="justme"
For Each cell In Target
If cell.Value <> "" Then
With cell.Offset(0, 1)
.Value = Now
.Locked = True
End With
End If
Next
End If
EndItAll:
Application.EnableEvents = True
'ActiveSheet.Protect Password:="justme"
Range("e2").Value = Environ("UserName")
End Sub