473,394 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 12639
"...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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lyn | last post by:
Hi, I have a text control on a form which is bound to table field StartDate which is in Date format. When updating the table record via the form, any data entered into the StartDate control is...
5
by: Lyn | last post by:
Hi, In the BeforeUpdate event of a textbox control I have the following simplified code:- Private Sub StartDate_BeforeUpdate(Cancel As Integer) MsgBox "StartDate Error -- Please Check and...
3
by: babylon | last post by:
any facilities in csharp that can help me implmenting undo/redo in my application? thx
5
by: HS Hartkamp | last post by:
Hi all, I am working with fairly large databases (> 500 Mb / < 2,000,000 rexcords), and often need to do action queries on these. I have the feeling that much of the computing power is going...
3
by: GoogleEyeJoe | last post by:
Dear ladies and gents, I'm trying to determine whether the .NET Framework implements a means of transactional processing without the need for a database. Essentially, I'd like to enlist...
4
by: =?Utf-8?B?UmljaA==?= | last post by:
Hello, Does vb2005 have a built-in UnDo feature / object for applications so that I can undo actions like other windows apps? Or do I have to write my own UnDo routine? If vb2005 does have a...
0
by: Katvis | last post by:
Hi guys, I am very new at this VB programming thing and need a script to undo a macro, I would appreciate your assistance, Sub DelEmpty() Selection.SpecialCells(xlCellTypeBlanks).Delete...
0
by: wizard of oz | last post by:
Hi all, I'm extending an Abstract Styled Document associated with a JTextPanel to implement a syntax highlighting editor. This is all working just fine - except for undo / redo. The problem...
1
by: Jeremy | last post by:
I'm working on an application that does some DOM manipulation. I want to add a mechanism for "Undo" so that the user can revert to the previous state after performing a mistaken action. Simple...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.