Excel VBA has the Application.OnUndo
function to handle this:
Public Sub DoSomething
... do stuff here
Application.OnUndo "Undo something", "UnDoSomething"
End Sub
Public Sub UnDoSomething
... reverse the action here
End Sub
More Related Contents:
- How do I get values from a hidden worksheet using VBA [closed]
- How to copy cells that contain certain text to another worksheet [closed]
- VBA Macro for copying and pasting columns on same excel sheet
- Levenshtein Distance in VBA [closed]
- VBA Runtime Error 1004 “Application-defined or Object-defined error” when Selecting Range
- How do I base64 encode a string efficiently using Excel VBA?
- Assign event handlers to controls on user form created dynamically in VBA
- Programmatic Access To Visual Basic Project Is Not Trusted
- Can I make this macro more efficient or faster?
- Conditional Formatting using Excel VBA code
- Controlling IE11 “Do you want to Open/Save” dialogue window buttons in VBA
- How to get the background color from a Conditional Formatting in Excel using VBA
- Excel vba add code to sheet module programmatically
- Best workaround for VBA Transpose array length limit?
- How to Lock the data in a cell in excel using vba
- How to use Events with Option Button Controls on Userform [duplicate]
- How do I use variables to set properties in VBA (Excel)
- VBA: Else without If Error
- Workbooks.Open Method in VBA
- Windows().Activate works on every computer except one
- How to highlight a cell using the hex color value within the cell?
- Convert RTF (Rich Text Format) code into plain text in Excel
- lastrow and excel table.
- Open a workbook from VBA and disable Workbook_Open() code?
- Creating form programmatically in the module using vba
- How to filter listbox values based on a Textbox value
- Find and FindNext for Excel VBA
- How do I get a list of unique values from a range in Excel VBA?
- How to get selected value in multicolumn listbox
- Query my excel worksheet with VBA