Private
Sub
Worksheet_Change(
ByVal
Target
As
Range)
Dim
rC
As
Range
Dim
P2
As
Range
Dim
cel
As
Range
Application.EnableEvents =
True
ActiveSheet.Unprotect Password:=
"Athens"
For
Each
cel
In
Target
If
cel.Value <>
""
Then
cel.Locked =
True
End
If
Next
cel
ActiveSheet.Protect Password:=
"Athens"
If
Not
Intersect(Target, Range(
"B:B"
))
Is
Nothing
Then
Application.EnableEvents =
False
For
Each
rC
In
Target.Cells
Range(
"F"
& rC.Row) = Now()
Range(
"G"
& rC.Row) = Environ(
"username"
)
Next
rC
Application.EnableEvents =
True
ElseIf
Not
Intersect(Target, Range(
"C:C"
))
Is
Nothing
Then
Application.EnableEvents =
False
For
Each
P2
In
Target.Cells
Range(
"H"
& P2.Row) = Now()
Range(
"I"
& P2.Row) = Environ(
"username"
)
Next
P2
Application.EnableEvents =
True
End
If
End
Sub