Private Sub Worksheet_Change(ByVal Target As Range)
Dim rig, col As Long, rng As Range
codfisc = Target.Value
cellainizio = Target.Address
Set rng = Range("a2:" & "a" & (Target.Row - 1))
For Each cl In rng
Application.EnableEvents = False
If cl = Target.Value Then
cl.Select
cl.Activate
rowr = cl.Row
lastcolumn = Cells(rowr, Columns.Count).End(xlToLeft).Column
ActiveCell.Offset(0, lastcolumn) = Now
Range(cellainizio).Clear
Application.EnableEvents = True
Exit Sub
End If
Next
rig = Target.Row
col = Target.Column
Cells(rig, col + 3).Value = Now
Application.EnableEvents = True
End Sub
|