Skip to content

Instantly share code, notes, and snippets.

@juliofruta
Last active January 16, 2021 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juliofruta/7a747c8250e28d587b21138710bc1112 to your computer and use it in GitHub Desktop.
Save juliofruta/7a747c8250e28d587b21138710bc1112 to your computer and use it in GitHub Desktop.
Macro
Dim PreviousValue
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
PreviousValue = Target.Value
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value <> PreviousValue Then
Debug.Print Date
For Each cell In Worksheets("Sheet1").Range("A1:E1")
If cell.Value <> Cells(1, Target.Column) Then
Debug.Print "Campo"
Debug.Print Cells(cell.Row, cell.Column).Value
Debug.Print "Valor"
Debug.Print Cells(Target.Row, cell.Column).Value
End If
Next
Debug.Print "Campo cambiado"
Debug.Print Cells(1, Target.Column).Value
Debug.Print "Valor anterior"
Debug.Print PreviousValue
Debug.Print "Nuevo Valor"
Debug.Print Target.Value
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment