phildetwei
New Member
- Joined
- Jan 20, 2007
- Messages
- 30
Hello all.
I use the code below to record the time a cell value changes. This works good so long as the cell was changed by direct input. I have a case where it would valuable to be able to automatically record the time/date a cell was modified for cells that are changing, but changing only by way of a refresh from a query on an Access database and not by having data directly inputed into them.
If somebody could start me off in the right direction I think I could get something working but I am not sure if I can use something similar to my existing code or if I need to start using a totally different method to accomplish this (I suspect the latter).
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Excel.Range("A" & n).Value <> "" Then
Excel.Range("B" & n).Value = Now
End If
End If
enditall:
Application.EnableEvents = True
End Sub
Any help is much appreciated, THANK YOU!
I use the code below to record the time a cell value changes. This works good so long as the cell was changed by direct input. I have a case where it would valuable to be able to automatically record the time/date a cell was modified for cells that are changing, but changing only by way of a refresh from a query on an Access database and not by having data directly inputed into them.
If somebody could start me off in the right direction I think I could get something working but I am not sure if I can use something similar to my existing code or if I need to start using a totally different method to accomplish this (I suspect the latter).
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Excel.Range("A" & n).Value <> "" Then
Excel.Range("B" & n).Value = Now
End If
End If
enditall:
Application.EnableEvents = True
End Sub
Any help is much appreciated, THANK YOU!