Need to modify code
When i try this i get the error Compile Error: Invalid or unqualified
reference.
Any ideas?
"Harald Staff" wrote:
Hi
When pasting then target may be multiple cells. Your code exits if
target.count is 1.
Try something like
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Cel as Range
For each Cel in Target
If Not Intersect(Range("D9:D374"), .Cel) Is Nothing Then
Application.EnableEvents = False
With Cel.Offset(0, 9)
'.NumberFormat = "dd mmm yyyy hh:mm:ss"
.Value = Date
End With
End If
Next
HTH. Best wishes Harald
"Greg H." wrote in message
...
I am using the following code to track when i make a change to a cell
value.
It works great but i need to make a modification i dont know how to do.
If i
type a value in any cell in the range of D9:D374, the date gets populated.
If i copy and paste a value in to that range, the date is not populated.
I
need it to be able to work with the copy/paste. Any help would be greatly
appreciated.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(Range("D9:D374"), .Cells) Is Nothing Then
Application.EnableEvents = False
With .Offset(0, 9)
'.NumberFormat = "dd mmm yyyy hh:mm:ss"
.Value = Date
End With
End If
Application.EnableEvents = True
End With
End Sub
|