Bonjour Eric et Schmail
Je pense qu'il y a confusion dans ce Fil.
Schmail voudrait un Undo Button dans son UserForm... (Donc Undo d'un macro, si j'ai compris...)
Eric propose, semble-t'il, Application.Undo qui n'est pas applicable d'après ce que j'ai dans l'aide (sorry je suis travaille en US "It cannot be used to undo Visual Basic commands")
Non l'exemple dont parles Eric c'est plutot à UndoAction que Schmail devrait s'orienter...
Voici ce que dis mon aide :
The Undo command in the user interface uses the UndoAction method. For example, if you paste text into a TextBox, you can use UndoAction to remove that text and restore the previous contents of the TextBox.
Not all user actions can be undone. If an action cannot be undone, the Undo command is unavailable following the action.
Note If the CanUndo property is False, the Undo command is not available in the user interface, and UndoAction is not valid in code.
If UndoAction is applied to a form, all changes to the current record are lost. If UndoAction is applied to a control, only the control itself is affected.
You must apply this method before the form or control is updated. You may want to include this method in a form's BeforeUpdate event or a control's Change event.
UndoAction is an alternative to using the SendKeys Statement to send the value of ESC in an event procedure.
Pour le SendKey Echappe ==> Sendkey SendKeys "{ESC}"
Bon Appétit.
@+Thierry