how to get change history in VBA

  • Thread starter Thread starter Z.J. Da
  • Start date Start date
Z

Z.J. Da

Is there any way to get change history in VBA. We can get
it from history sheet, but the sheet is not updated
quickly enough.

The purpose for me to get the history is to obtain old
value and cell ID in sheetChange handler. Is there any
other way to get them instead of from histroy?

Thank you in advance,

Z.J.
 
One way:

Dim gOldCellValue As Variant

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
MsgBox "Old: " & gOldCellValue & vbNewLine & _
"New: " & Target.Value
gOldCellValue = Target.Value
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
gOldCellValue = Target.Value
End Sub
 
Back
Top