Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Creating my own undo


I know that as soon as I do something to Excel in VBA I
loose my undo buffer which is extremely annoying. I am
trying to get round this by building me own undo stack. I
can undo my code and I can store other changes from the
applications App_SheetChange event.

The problem I have is format changes do not fire the
sheet change event. Is there any way to detect when this
occurs?

Alternatively any other ideas on undo solutions would
also be much appreciated.

Thanks

Nigel
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Creating my own undo

Hi Nigel,

AFAIK there's know of any simple way to do what you seek.
As you say Format changes do not trigger an event, though
you may be able to track changes that occur following
SelectionChange and/or Change events, compared with the
state prior. Along the lines of what you are already doing
but could involve a lot more code. But I don't think it
will ever be foolproof.

Depending on your needs you may be able to copy and paste
(or pastespecial formats) to a hidden sheet somewhere. I
find this method works well for my needs, I don't offer a
multi level undo but undo to original state by pasting
back. It does have limitations as a catch all. One, of
several problems to overcome, is if user inserts/deletes
rows or columns (also no event).

You might be able to tie this into the "Undo Method" (see
help), although I just attach to a Cancel button.

Regards,
Peter

-----Original Message-----

I know that as soon as I do something to Excel in VBA I
loose my undo buffer which is extremely annoying. I am
trying to get round this by building me own undo stack. I
can undo my code and I can store other changes from the
applications App_SheetChange event.

The problem I have is format changes do not fire the
sheet change event. Is there any way to detect when this
occurs?

Alternatively any other ideas on undo solutions would
also be much appreciated.

Thanks

Nigel
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Creating my own undo

Hi Nigel

Look on John's site for a example
http://www.j-walk.com/ss/excel/tips/tip23.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Nigel" wrote in message ...

I know that as soon as I do something to Excel in VBA I
loose my undo buffer which is extremely annoying. I am
trying to get round this by building me own undo stack. I
can undo my code and I can store other changes from the
applications App_SheetChange event.

The problem I have is format changes do not fire the
sheet change event. Is there any way to detect when this
occurs?

Alternatively any other ideas on undo solutions would
also be much appreciated.

Thanks

Nigel



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Creating my own undo

Thanks Peter as I thought it will be al hell of lot of
work to do and I'm not sure I would be happy running that
much code every time a user made a selection change. I
looks like I have no choice other than to only offer one
level undo.
I don't understand why Excel clears the undo buffer, why
you can't just add your own procedure into the stack.
When your trying to produce a quality Addin the end user
wants everything else to behave as normal eg. Multi undo.

Cheers anyway.

Nigel


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
UNDO - not available Chris T-M Excel Discussion (Misc queries) 3 February 17th 09 01:11 AM
can't undo DPW1 Excel Discussion (Misc queries) 4 July 5th 05 08:07 PM
UNDO - how many times can I UNDO? Jane Excel Worksheet Functions 2 May 19th 05 03:03 AM
Why is my undo function in Excel only can undo the last 1 or 2 ch. 1111111111111111111111111111111111111111 Excel Worksheet Functions 1 November 24th 04 11:13 AM
Undo Please? Jerett Excel Programming 2 December 26th 03 09:33 PM


All times are GMT +1. The time now is 12:43 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"