problem with undo and a user form

F

filo666

Hi, in the following link: http://j-walk.com/ss/excel/tips/tip23.htm

it is well explained how to activate the undo comand if a VBA code is run,
my rpbolem is that I have a userform and when I activate my userform and my
userform change the data on the range I can not undo the actions, all the
saved variavles are errased when the user form is initialisated.

for example:

I have a userform that add a number (that the user type in the textbox) to
all the selected range, when the adding is performed the undo action is
errased.

how to accomplish my goal???

TIA
 
N

Nigel

One option would be for the data on the sheet to be passed to an array, then
onto the UserForm. Changes on the UserForm then get passed to the array and
back into the sheet. The array therefore stores the last changes in the
UserForm which can be used to undo the sheet changes. So even if the
UserForm is unloaded your array still holds the values.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top