How do I restore Excel's undo history after running a macro?

mdelia1

New Member
Joined
Jun 11, 2014
Messages
1
I'm a VBA newbie, but managed to implement (aka copy) a macro that adds a time/date stamp in Column A when any of the subsequent cells in that row are changed. With this now working, I really need the ability to restore the undo history in case a change to the data needs to be reverted. Thanks!Sub procedure:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
Application.EnableEvents = False
For Each c In Target
If c.Column > 1 And c.Column < 21 Then
Cells(c.Row, 1) = Now
End If
Next c
Application.EnableEvents = True
End Sub
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi mdelia. Welcome to the board.

I was looking in to this closely t'other day for an unrelated post and the general consensus is there is no way of maintaining or restoring the undo stack after a macro has been run. There's some more reading on same here...
Preserving the Undo List (Microsoft Excel)
Excel Developer Tip: Undoing a VBA Subroutine (this is pretty hardcore, above my level)

Hopefully someone else will jump in here and prove me wrong but the evidence seems pretty overwhelming.

Sorry

/AJ
 
Upvote 0
Adam is correct, the Undo stack is cleared once a macro has been run...and cannot be recovered.
 
Upvote 0

Forum statistics

Threads
1,223,967
Messages
6,175,674
Members
452,666
Latest member
AllexDee

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