Hello,
I am using the following code in an excel workbook. My issue is that with this code (which is needed), the user looses the ability to use the "undo" feature if they make a mistake. Is there any way around that?
Thanks
I am using the following code in an excel workbook. My issue is that with this code (which is needed), the user looses the ability to use the "undo" feature if they make a mistake. Is there any way around that?
Thanks
Code:
Private Sub Worksheet_Calculate()
Dim iLastRow As Long
Dim mws As Worksheet
Set mws = ThisWorkbook.Sheets("My Sheet")
mws.Range("a1000") = "New Value"
mws.Range("b1000") = "Date/Time Changed"
iLastRow = mws.Cells(mws.Rows.Count, "a").End(xlUp).Row
If mws.Range("B384").Value <> mws.Cells(iLastRow, "a").Value Then
mws.Cells(iLastRow + 1, "a") = mws.Range("B384").Value
mws.Cells(iLastRow + 1, "b") = Format(Now(), "mm/dd/yyyy hh:nn:ss")
End If
End Sub