How to undo ClearContents?

  • Thread starter Thread starter joeu2004
  • Start date Start date
J

joeu2004

Currently, I do Range(...).ClearContents. Apparently, that cannot be
undone by ctrl-Z in Excel.

Is there any way to accomplish the same thing (in VB) so that it can
be undone by ctrl-Z in Excel?
 
hi
unfortunately running macros bypasses all of the built in niceities of
excel. once you have run a macro, there is little chance of going back.
see this site....
http://j-walk.com/ss/excel/tips/tip23.htm
undo a vba sub routine.
caution: when i click on my link, i got a not found message. but i went to
http://j-walk.com>spreadsheetpage>developerstips....
down towards the bottom.
code to undo.
p.s. not easy. good luck.

regards
FSt1
 
unfortunately running macros bypasses all of the built in niceities
of excel. once you have run a macro, there is little chance of
going back.

Thanks. Not surprised. Just thought I'd ask.
 
Thanks. Not surprised. Just thought I'd ask.

There are PutInClipboard and GetFromClipboard methods in VBA. I have
not used them. But I imagine you could write a MyClearContents sub in
which the current selection is put into the clipboard and then the
range is cleared. You can read up on the method's VBA documentation
to figure out if it would work in your case.

SteveM
 
Back
Top