View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Codes for Undoing

You can't undo macros.

Public oldvalue
'put above as top line in module

Sub clearem()
oldvalue = Cells(1, 1)
Cells(1, 1).ClearContents
End Sub

Sub undoem()
Cells(1, 1) = oldvalue
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"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.