ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   problem with undo and a user form (https://www.excelbanter.com/excel-programming/407797-problem-undo-user-form.html)

filo666

problem with undo and a user form
 
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

Nigel[_2_]

problem with undo and a user form
 
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.



--

Regards,
Nigel




"filo666" wrote in message
...
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




All times are GMT +1. The time now is 07:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com