Jun 15, 2004 #1 NatHunter Technical User Aug 17, 2001 51 GB Is it possible to use the excel undo functionality from VBA code? If so, how is it done?
Jun 15, 2004 #2 xlbo MIS Mar 26, 2002 15,080 GB There is no UNDO function within VBA - AFAIK, you could only reference it by using SENDKEYS to activate the menu option Rgds, Geoff Never test the depth of water with both feet Help us to help you by reading FAQ222-2244 before you ask a question Upvote 0 Downvote
There is no UNDO function within VBA - AFAIK, you could only reference it by using SENDKEYS to activate the menu option Rgds, Geoff Never test the depth of water with both feet Help us to help you by reading FAQ222-2244 before you ask a question
Jun 15, 2004 Thread starter #3 NatHunter Technical User Aug 17, 2001 51 GB Thanks, Geoff. I cannot seem to get excel ('97) to recognise a CTRL (^) key in sendkeys - any ideas? I can get the shift and alt keys to work but not CTRL: Private Sub cmdUndo_Click() Call SendKeys("^Z", True) End Sub Doesn't do anything. This is attached to a command button... Paul Upvote 0 Downvote
Thanks, Geoff. I cannot seem to get excel ('97) to recognise a CTRL (^) key in sendkeys - any ideas? I can get the shift and alt keys to work but not CTRL: Private Sub cmdUndo_Click() Call SendKeys("^Z", True) End Sub Doesn't do anything. This is attached to a command button... Paul
Jun 15, 2004 #4 xlbo MIS Mar 26, 2002 15,080 GB use Application.sendkeys Rgds, Geoff Never test the depth of water with both feet Help us to help you by reading FAQ222-2244 before you ask a question Upvote 0 Downvote
use Application.sendkeys Rgds, Geoff Never test the depth of water with both feet Help us to help you by reading FAQ222-2244 before you ask a question
Jun 15, 2004 #5 PHV MIS Nov 8, 2002 53,708 FR In Excel97 SendKeys "^Z" works as expected, ie sends Ctrl-Z to the active window. However, a macro action is NOT undoable. Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244 Upvote 0 Downvote
In Excel97 SendKeys "^Z" works as expected, ie sends Ctrl-Z to the active window. However, a macro action is NOT undoable. Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244