Channel | Publish Date | Thumbnail & View Count | Actions |
---|---|---|---|
| 2014-08-07 12:24:25 | ![]() 8,624 Views |
Welcome to episode 1904 of the MrExcel podcast. In this episode, we will be discussing a common misconception about macros in Excel. Many people believe that every time a macro is run, the undo stack is cleared. However, as we will see, this is not always the case.
In yesterday’s episode, we demonstrated an event handler macro that automatically wrote data to a column when a change was made in another column. We were going to record an addendum to that episode, warning about the potential issue with event handler macros. Traditionally, it is believed that every time a macro is run, the undo stack is cleared. However, as we will see, this is not always true.
To demonstrate this, we were going to delete and overwrite some data and then try to undo it. However, to our surprise, the undo function was still working. Upon further research, we discovered that the undo stack is only cleared when the macro writes something to the worksheet. If the macro only performs analysis and does not make any changes to the worksheet, the undo stack remains intact.
This means that if your macro only makes changes based on certain criteria, such as a specific column or value, the undo stack will not be cleared unless those criteria are met. This was a revelation for me, as I had always believed that any macro would clear the undo stack. But now we know that this is not the case. Thank you for tuning in to this episode of the MrExcel podcast, and we’ll see you next time for another informative netcast.
Buy Bill Jelen’s latest Excel book: https://www.mrexcel.com/products/latest/
You can help my channel by clicking Like or commenting below: https://www.mrexcel.com/like-mrexcel-on-youtube/
Table of Contents:
(00:00) Every Macro Does Not Clear UnDo Stack
(00:16) Event Handler Macro Explanation
(00:28) Warning about Event Handler Macros
(00:40) Traditional Belief about Clearing Undo Stack
(00:50) Demonstration of Undo Functionality
(01:02) Unexpected Undo Behavior
(01:14) Research and Explanation of Undo Stack Rule
(01:48) Analysis vs. Writing to Worksheet
(02:17) Misconception about Clearing Undo Stack
(02:30) Clicking Like really helps the algorithm
#excel #microsoft #microsoftexcel #exceltutorial #exceltips #exceltricks #excelmvp #freeclass #freecourse #freeclasses #excelclasses #microsoftmvp #walkthrough #evergreen #spreadsheetskills #analytics #analysis #dataanalysis #dataanalytics #mrexcel #spreadsheets #spreadsheet #excelhelp #accounting #tutorial #excelvba #excelundo
This video answers these common search terms:
impact of vba on excel’s undo feature
vba code and excel undo functionality
excel undo history after running vba macro
excel vba macro and undo stack
does vba code clear excel undo history?
undo stack behavior in vba macros
undo feature and vba script in excel
Join the MrExcel Message Board discussion about this video at https://www.mrexcel.com/board/threads/1153731/
Please take the opportunity to connect and share this video with your friends and family if you find it useful.