Undo function in Userform

  • Thread starter Thread starter Tyro
  • Start date Start date
T

Tyro

I'm a novice...this may be a simple one...
I have a Userform that allows adding /editing data in an Excel worksheet
which works fine.
I would like to provide an option in my Userform to UNDO it if they made a
mistake and revert back the
data back to its previous state. How and where should I code it under ?

Thanks a bunch!!
Tyro
 
As far as I know...and happy to be told otherwise. but When using
macros/code to make changes you lose the ablity to undo...as a normal
operation.
The only way is reverse your code...or keep a copy on another sheet of
the step before last change and copy it across to the current sheet you
are editing.
 
You would have to code is explicitly. That means you would have to record
what the previous values were before you change them. Then in your undo
routine, restore those values by writing them back to the appropriate cells.

There is no build in support for this. It is all done by your code.
 
Thanks for the feedback...I'll give that a try...it might take me a while to
get my
codings right or even make it work !! Thanks again !!

As far as I know...and happy to be told otherwise. but When using
macros/code to make changes you lose the ablity to undo...as a normal
operation.
The only way is reverse your code...or keep a copy on another sheet of
the step before last change and copy it across to the current sheet you
are editing.
I'm a novice...this may be a simple one...
I have a Userform that allows adding /editing data in an Excel worksheet
[quoted text clipped - 5 lines]
Thanks a bunch!!
Tyro
 
Thanks for the feedback..!!...I'll try this option as well.. I'm following
the suggested logic,
it will probably just take me a while to code this properly. ..Thanks, again!


Tom said:
You would have to code is explicitly. That means you would have to record
what the previous values were before you change them. Then in your undo
routine, restore those values by writing them back to the appropriate cells.

There is no build in support for this. It is all done by your code.
I'm a novice...this may be a simple one...
I have a Userform that allows adding /editing data in an Excel worksheet
[quoted text clipped - 5 lines]
Thanks a bunch!!
Tyro
 
Back
Top