VBA study notes (5) - The event, recording each operation changes VBA study notes (5) - event record every change operation

Description (2017.3.24):

1. Record sheet1 inside each change, and change time!

2. Do not delete recorded a wide range of changes will prompt "Type Mismatch"

1 Private Sub Worksheet_Change(ByVal Target As Range)
2    Worksheets(2).Cells(Worksheets(2).[A65536].End(xlUp).Row + 1, 1) = Target.Address & "->" & Target.Value
3    Worksheets(2).Cells(Worksheets(2).[A65536].End(xlUp).Row + 1, 2) = Now()
4 End Sub

Description (2017.3.24):

1. Record sheet1 inside each change, and change time!

2. Do not delete recorded a wide range of changes will prompt "Type Mismatch"

1 Private Sub Worksheet_Change(ByVal Target As Range)
2    Worksheets(2).Cells(Worksheets(2).[A65536].End(xlUp).Row + 1, 1) = Target.Address & "->" & Target.Value
3    Worksheets(2).Cells(Worksheets(2).[A65536].End(xlUp).Row + 1, 2) = Now()
4 End Sub

Guess you like

Origin www.cnblogs.com/medik/p/10989739.html