Undo Button

jabawalkie5000

New Member
Joined
Jun 13, 2011
Messages
41
I have a macro that brings up a user form that allows me to chose from a tab called "sheet1" which files I want to open. "Sheet1" is an import listing files from a particular directory. Selected files are stored in a tab called "list". This user form has two buttons on it, "ok" and "close". "ok" is to select a file, "close" is to finish after selection. I want an undo button that can allow you to undo previous selection in turn in reverse order. Similar to the undo function in excel, can you help with this?

Thanks
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi
This is not necessarily an easy process. VBA clears the undo stack when a macro is run, so there is no data to undo to!!
I guess you could store the data that changes, as a variable and call it back if there is an error.....but I can't imagine that being efficient if there was a lot of it !!
 
Upvote 0
There will only ever be no more than 30 files so 30 records tops. If this is not easy, can you do a coding that asks vba to clear down and restart selection?

Hi
This is not necessarily an easy process. VBA clears the undo stack when a macro is run, so there is no data to undo to!!
I guess you could store the data that changes, as a variable and call it back if there is an error.....but I can't imagine that being efficient if there was a lot of it !!
 
Upvote 0
I may have been a little conservative in my comments.....rather than saying "not easy", I probably should have said...."can't do".
Maybe your current code could be changed to clear all the imported files, so that you can re import a new selection.
If that is an option....post the code you already have.
I may not get a look at it tonight, but will be back online tomorrow afternoon.
 
Upvote 0
Thanks, done a restart again command button, clears down the lot.

I may have been a little conservative in my comments.....rather than saying "not easy", I probably should have said...."can't do".
Maybe your current code could be changed to clear all the imported files, so that you can re import a new selection.
If that is an option....post the code you already have.
I may not get a look at it tonight, but will be back online tomorrow afternoon.
 
Upvote 0
Which other query ?
AND
maybe tomorrow....time for bed in OZ !
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,278
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top