Hello,
I have already created a macro to do some operations on a spreadsheet, and I also want to be able bring this spreadsheet back to its original format and restore all changes (UNDO).
I do know, that in Excel you can't undo a Macro directly so probably I was thinking if there's an alternative solution that I can write code to create this Undo Macro.
I was initially thinking of "reverse engineering" the original code from the first Macro.
Although, somewhere online I found an alternative solution that does it in a way where it stores the original spreadsheet in a variable, then by calling a Boolean if it's true to return the variable that we have stored our original spreadsheet. And this was coded in the code of our original Macro. But I am not sure on how to use it within the first macro, or if it's necessary to create a separate macro to complete my task. If this is the case, do I have to store the variable of the spreadsheet as a global variable?
What should I do about this?
I have already created a macro to do some operations on a spreadsheet, and I also want to be able bring this spreadsheet back to its original format and restore all changes (UNDO).
I do know, that in Excel you can't undo a Macro directly so probably I was thinking if there's an alternative solution that I can write code to create this Undo Macro.
I was initially thinking of "reverse engineering" the original code from the first Macro.
Although, somewhere online I found an alternative solution that does it in a way where it stores the original spreadsheet in a variable, then by calling a Boolean if it's true to return the variable that we have stored our original spreadsheet. And this was coded in the code of our original Macro. But I am not sure on how to use it within the first macro, or if it's necessary to create a separate macro to complete my task. If this is the case, do I have to store the variable of the spreadsheet as a global variable?
What should I do about this?