Timestamp Issue - no undo feature.

Hootywho

Board Regular
Joined
Oct 11, 2010
Messages
90
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

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
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,224,583
Messages
6,179,671
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top