ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to undo ClearContents? (https://www.excelbanter.com/excel-programming/405479-how-undo-clearcontents.html)

joeu2004

How to undo ClearContents?
 
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?

JLGWhiz

How to undo ClearContents?
 
Nope

"joeu2004" wrote:

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?


FSt1

How to undo ClearContents?
 
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.comspreadsheetpagedeveloperstips....
down towards the bottom.
code to undo.
p.s. not easy. good luck.

regards
FSt1


"joeu2004" wrote:

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?


joeu2004

How to undo ClearContents?
 
On Feb 1, 6:16*pm, FSt1 wrote:
"joeu2004" wrote:
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?


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.

SteveM

How to undo ClearContents?
 
On Feb 1, 11:29 pm, joeu2004 wrote:
On Feb 1, 6:16 pm, FSt1 wrote:

"joeu2004" wrote:
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?


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.


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


All times are GMT +1. The time now is 10:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com