Last active
January 16, 2021 06:17
-
-
Save juliofruta/7a747c8250e28d587b21138710bc1112 to your computer and use it in GitHub Desktop.
Macro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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