I have a table called GastosCC with 3 columns. These Columns are: DATA, VALOR and ITEM.
When I change a value in the VALOR column, I want the DATE column to be updated, on the same line as the VALOR column change, with the update date.
I did this code, it doesn't show any errors when saving, but it doesn't update the DATA column line.
thanks for the help
When I change a value in the VALOR column, I want the DATE column to be updated, on the same line as the VALOR column change, with the update date.
I did this code, it doesn't show any errors when saving, but it doesn't update the DATA column line.
thanks for the help
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim GastosCC As ListObject
Dim Cell As Range
Set GastosCC = Me.ListObjects("GastosCC") '
If Not Intersect(Target, GastosCC.ListColumns("VALOR").DataBodyRange) Is Nothing Then
Application.EnableEvents = False
For Each Cell In Target
If Not IsEmpty(Cell.Value) Then
Cell.Offset(0, -1).Value = Now
End If
Next Cell
Application.EnableEvents = True
End If
End Sub