Funny thing about <Ctrl> Z

BMD

Board Regular
Joined
Oct 5, 2005
Messages
211
It quit working. If I make a change to the sheet and wish to undo it I just hit Ctrl Z, but it quit working. How do I turn it back on?
 

Some videos you may like

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Von Pookie

MrExcel MVP
Joined
Feb 17, 2002
Messages
13,686
Do you have a macro making the change on the sheet? Or a Worksheet_Change macro that runs on that sheet?

You can't undo anything directly after a macro runs.
 

BMD

Board Regular
Joined
Oct 5, 2005
Messages
211
I did not know I have two macros, one on ThisWorkbook Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
and one on sheet 17
Sub Worksheet_Change(ByVal Target As Excel.Range)
 

Von Pookie

MrExcel MVP
Joined
Feb 17, 2002
Messages
13,686
Yep, that would do it, depending on how the macros are coded.

Workbook_SheetChange will run whenever a change is made on any sheet in the workbook unless specified within the macro code.

So when you make a change on the sheet, that macro triggers and wipes out any chance you had of undoing anything up until that point.

I think this only happens with macros that are affecting the sheets in some way, though. For example, if I run a macro that does nothing but display a message box, I am still able to use 'undo'. But if I run a macro that puts a value in cell A1, the undo arrow becomes grayed out.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,229
Messages
5,571,019
Members
412,354
Latest member
Stj99
Top