Need to know difference between last redo or any other sheetchange

onidarbe

Board Regular
Joined
Mar 22, 2013
Messages
65
Hi,
I'm almost there to solve the loss of undo/redo-stack and clipboard by VBA made changes.
I can already find out if the last keypress was undo or redo:
Code:
    If GetKeyState(vbKeyY) And -128 And GetKeyState(vbKeyControl) And -128 Then ' "Ctrl-Y" has been pressed
    If GetKeyState(vbKeyZ) And -128 And GetKeyState(vbKeyControl) And -128 Then ' "Ctrl-Z" has been pressed

The only problem now is that I need to find out in Workbook_SheetChange if the last redo-count from 1 to 0 is a result from:
1) an actual mouse-click on the redo-button
2) or because of any other sheetchange that will also lose the last redo, setting it also from 1 to 0

So far I would capture the mouse click on the location where the buttons undo/redo are, but there position could change (Excel-version or User-defined)!

Any idea is welcome to investigate....

Thanks
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,215,755
Messages
6,126,683
Members
449,328
Latest member
easperhe29

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