ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook_SheetChange event (https://www.excelbanter.com/excel-programming/407611-workbook_sheetchange-event.html)

PO

Workbook_SheetChange event
 
Excel 2003, Sp2

Hi

I want to track changes in cells made by the user in the workbook. I use the
Workbook_SheetChange event.
The example below prints the value the user changed TO. Howerver, sometimes
I want to print the value the user changed FROM.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Debug.Print Target.Value
End Sub

How can I find out the value the user changed FROM?

Regards
Pete



[email protected]

Workbook_SheetChange event
 
Hi
You could capture the cell value when the user selects the cell

Public FromValue As Variant

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal
Target As Range)
FromValue = Target.Value
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
Debug.Print Target.Value
Debug.Print FromValue
End Sub

regards
Paul

On Mar 13, 12:53*am, "PO" <h wrote:
Excel 2003, Sp2

Hi

I want to track changes in cells made by the user in the workbook. I use the
Workbook_SheetChange event.
The example below prints the value the user changed TO. Howerver, sometimes
I want to print the value the user changed FROM.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
* * Debug.Print Target.Value
End Sub

How can I find out the value the user changed FROM?

Regards
Pete




All times are GMT +1. The time now is 03:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com