View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Varne Varne is offline
external usenet poster
 
Posts: 126
Default Codes for Undoing

Thanks.

Could you please show me any method to do it - if any -?

M Varnendra

"Mike Fogleman" wrote:

From Help for Undo...
This method undoes only the last action taken by the user before running the
macro, and it must be the first line in the macro. It cannot be used to undo
Visual Basic commands.

It can't Undo a VB command to ClearContents

You can assign the contents to a variable, ClearContents and then re-assign
the variable to the cell.



Mike F

"Varne" wrote in message
...
Hi

Could somebody give me codes for undoing? It is urgent.

Sub Test ()

Cells(1,1).ClearContents
Application.Undo

End Sub

The above does not work.

Thanks.