Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Excel Undo Functionality using VBA

Status
Not open for further replies.

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?
 
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
 
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
 
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top