Lost undo, can't undo

drhatmrexcel

Board Regular
Joined
Oct 30, 2009
Messages
69
I have 10 sheets (tabs) in a workbook which are named as follows:
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p> </o:p>
HELP - Read this
Historical
Payees
ExpenseCategory
Budget
Expense Entry
App
Current App - Pivot Table
All Apps - Pivot Table
Budget Tracker
<o:p> </o:p>
4 of the sheets have an embedded macro that is causing loss of the “undo” function on those 4 sheet (tabs).
The embedded macro watches for a cell change, and if detected, then the two pivot tables on the separate pivot table sheets will be refreshed. The 4 sheets with the embedded macros are ExpenseCategory, Budget, Expense Entry, and App.
<o:p> </o:p>
The embedded macro is in the Worksheet section of the Visual Basic editor, and in the SelectionChange portion.
<o:p> </o:p>
Here is the macro that is giving me the headache.
<o:p> </o:p>
<o:p> </o:p>
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False
Sheets("Current App - Pivot Table").PivotTables("PivotTable1").PivotCache.Refresh
Sheets("All Apps - Pivot Table").PivotTables("PivotTable2").PivotCache.Refresh
Application.ScreenUpdating = True
End Sub
<o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
<o:p> </o:p>
Any ideas on why I am losing the “undo” function or how I can change the macro and regain the “undo” function?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Use of worksheet_change macros cause the undo stack to be cleared when they trigger. It's a side effect you have to live with when you employ these event macros.

The only workaround would be to rewrite the macros as regular macros and activate them manually, or via button, instead of letting them trigger themselves via event-code.
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,961
Latest member
nzskater

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