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
(E-Mail Removed)
"Varne" <(E-Mail Removed)> wrote in message
news:375814E8-5736-4BA8-AC9A-(E-Mail Removed)...
> 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.