Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Application.OnUndo Questions - Loses Prior Undo's and Runs 1x

the undo history is cleared by many macro actions. It is a pretty good
assumption to say you can't undo actions done by a macro. To the best of my
knowledge, using onundo replaces any built in undo capability - it doesn't
accumulate as history. If you want to undo a series of action, you would
have to make provision to record what was done, then have your macro access
that list and reverse it - perhaps querying the user for the actions to undo
or again, setting the onundo with a macro to do the next level of undos.

Basically the entire operation is your responsibility to code.

--
Regards,
Tom Ogilvy

"David Copp" wrote in message
. ca...
Hi,

Looking for comments + thoughts on the following.

When I programmatically assign Undo to my own procedure, I've noticed 2
things under 97 and 2K;
1. If I perform a series of standard Excel actions (e.g. add values to
cells), a list of the actions is available to undo (remove the values) via
the Undo icon in toolbar.
If however, I run "change_cells" once (shown below), all prior Undo

actions
to remove values are toast and left with "Undo Actions" only.
2. If change_cells is run multiple times, then only LAST "Undo Additions"

is
available. (i.e. what happened to prior "Undo Additions"? If run
"change_cells" 3x then hoping to see "Undo Additions" 3x under Undo icon

in
toolbar).
I'm more than happy to be responsible controlling how many times

undo_cells
runs but I would like it to be available more than once.
I also threw in the time (Application.OnUndo "Undo " & Time() ,
"undo_cells") and confirms that only most recent call to OnUndo is kept.
(ARG!)


Sub change_cells()
Cells(1, 1) = Cells(1, 1) + 1
Application.OnUndo "Undo Additions", "undo_cells"
End Sub


Sub undo_cells()
Cells(1, 1) = Cells(1, 1) - 1
Application.OnUndo "Undo Additions", "undo_cells"
End Sub


Thanks in advance,

Dave






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA macro runs fine, but freezes if I try to do ANYTHING else whileit runs Rruffpaw Setting up and Configuration of Excel 1 September 17th 11 01:25 PM
Answers to questions posing more questions in a workbook sbelle1 Excel Worksheet Functions 2 August 8th 09 01:02 AM
View Questions and Answer to questions I created Roibn Taylor Excel Discussion (Misc queries) 4 July 24th 08 12:05 AM
How do you change the number of undo's in excel Jerry[_4_] Excel Discussion (Misc queries) 4 November 10th 07 06:31 PM
One macro runs then it auto runs another macro PG Excel Discussion (Misc queries) 2 September 1st 06 09:30 PM


All times are GMT +1. The time now is 05:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"