469,266 Members | 2,028 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,266 developers. It's quick & easy.

How to Undo a VBA macro?

I've written, er, that is, recorded and re-written a lot of little useful
macros to help me with a spreadsheet dealing with financial investments.
Very handy they are, yes, but sometimes I wish I could undo what one of
them just screwed up for me.

Is there any sort of checkpoint capability I could bodge into the code?
The help index doesn't seem to know what that checkpointing means, no
surprise, since I dredged it up from my ancient mainframer days.

On a completely unrelated thought thread, can anyone tell me if I'll be
shafted by upgrading from Excel 2000? Will all my VBA code be broken,
replaced with a error window telling me I need to learn VFA (Visual Fred
for Apps)?
Jul 17 '05 #1
3 12443
"...And the next sign of the Apocalypse will be..."
*****
On Mon, 16 Feb 2004 14:30:35 GMT, Enigman O'Maly wrote:
I've written, er, that is, recorded and re-written a lot of little useful
macros to help me with a spreadsheet dealing with financial investments.
Very handy they are, yes, but sometimes I wish I could undo what one of
them just screwed up for me.

Is there any sort of checkpoint capability I could bodge into the code?
The help index doesn't seem to know what that checkpointing means, no
surprise, since I dredged it up from my ancient mainframer days.

On a completely unrelated thought thread, can anyone tell me if I'll be
shafted by upgrading from Excel 2000? Will all my VBA code be broken,
replaced with a error window telling me I need to learn VFA (Visual Fred
for Apps)?


This question belongs in an Excel group. I see that you posted your
second question in one, why not the first?

If you want an undo stack for VBA, you're up the proverbial creek. My
work-around is to save immediately before running one, and then if I
want to undo, I simply close and re-open. (I suppose you could write a
custom undo stack, maybe drop it into an add-in...)
--
auric "underscore" "underscore" "at" hotmail "dot" com
*****
C Programmers do it with the LARGE model!
Jul 17 '05 #2
On Mon, 16 Feb 2004 11:07:01 -0700, Auric__ <no*********@email.address>
wrote:
"...And the next sign of the Apocalypse will be..."
*****
On Mon, 16 Feb 2004 14:30:35 GMT, Enigman O'Maly wrote:
I've written, er, that is, recorded and re-written a lot of little useful
macros to help me with a spreadsheet dealing with financial investments.
Very handy they are, yes, but sometimes I wish I could undo what one of
them just screwed up for me.

Is there any sort of checkpoint capability I could bodge into the code?
The help index doesn't seem to know what that checkpointing means, no
surprise, since I dredged it up from my ancient mainframer days.

On a completely unrelated thought thread, can anyone tell me if I'll be
shafted by upgrading from Excel 2000? Will all my VBA code be broken,
replaced with a error window telling me I need to learn VFA (Visual Fred
for Apps)?


This question belongs in an Excel group. I see that you posted your
second question in one, why not the first?

If you want an undo stack for VBA, you're up the proverbial creek. My
work-around is to save immediately before running one, and then if I
want to undo, I simply close and re-open. (I suppose you could write a
custom undo stack, maybe drop it into an add-in...)


First, thanks for the comments on the undo stack. I suppose I'll have to
adopt your method, since I have no idea how to write such a thing.

I put the first question here because it seemed to be a purely VB-ish
question. The second question came to mind while posting the first, and
since it seemed more Excel-ish, I posted it in that group also.
Jul 17 '05 #3
On Wed, 18 Feb 2004 00:10:52 GMT, Enigman O'Maly wrote:
I put the first question here because it seemed to be a purely VB-ish
question. The second question came to mind while posting the first, and
since it seemed more Excel-ish, I posted it in that group also.


Well, since it was about programming Excel, it would have been better to
ask it in the Excel group. Not that it was off-topic here (after all,
this isn't c.l.v.b.everything.except.excel), but there's a reason why
that group has "excel.programming" in the name. ;)

Tom Ogilvy, the guru of m.p.e.p, gives this link as a good resource for
learning how to roll your own undo stack (and it applies somewhat to
regular VB, as well):
http://j-walk.com/ss/excel/tips/tip23.htm
--
auric "underscore" "underscore" "at" hotmail "dot" com
*****
Do not be led astray onto the path of virtue.
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Lyn | last post: by
5 posts views Thread by HS Hartkamp | last post: by
reply views Thread by Katvis | last post: by
reply views Thread by wizard of oz | last post: by
1 post views Thread by Jeremy | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.