Hi!
In Col A process references are registered.
In Col B the code registers the DateTime of the entry of each process.
In Col C the code records the DateTime of any change in the reference of each process.
For that I use the following code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LastDataEntry
If Target.Column > 1 Then Exit Sub
Application.EnableEvents = False
LastDataEntry = Target: Application.Undo
On Error Resume Next
If LastDataEntry <> Target Then
Target = LastDataEntry
If Target(, 2) = "" Then
Target(, 2) = Now
else
Target(, 3) = Now
End If
End If
In prototype it works fine.
I recently realized the need to make changes to the first 20 records (A2:A20) unfeasible.
Please, from rollis 13 I have the following code:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A2:A20")) Is Nothing Then
Application.OnKey "{DELETE}", ""
Else
Application.OnKey "{DELETE}"
End If
End Sub
In prototype it works fine.
When I try to use both codes in the project, the second one doesn't work.
I ask for your help because I cannot understand the conflict.
Thanks in advance.
anvs
In Col A process references are registered.
In Col B the code registers the DateTime of the entry of each process.
In Col C the code records the DateTime of any change in the reference of each process.
For that I use the following code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LastDataEntry
If Target.Column > 1 Then Exit Sub
Application.EnableEvents = False
LastDataEntry = Target: Application.Undo
On Error Resume Next
If LastDataEntry <> Target Then
Target = LastDataEntry
If Target(, 2) = "" Then
Target(, 2) = Now
else
Target(, 3) = Now
End If
End If
In prototype it works fine.
I recently realized the need to make changes to the first 20 records (A2:A20) unfeasible.
Please, from rollis 13 I have the following code:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A2:A20")) Is Nothing Then
Application.OnKey "{DELETE}", ""
Else
Application.OnKey "{DELETE}"
End If
End Sub
In prototype it works fine.
When I try to use both codes in the project, the second one doesn't work.
I ask for your help because I cannot understand the conflict.
Thanks in advance.
anvs