Delete Rows Macro With Undo

miketurn

Active Member
Joined
Dec 8, 2016
Messages
268
Hello Everyone,

Another task I find myself doing a lot of is deleting rows. I perform this function with the "DELETE ROWS" tool button, which is okay but find it a little uneffecient the amount that I use it and have to mouse up to it each time. I am aware that you can also right click and delete as well but even that I am not a fan of.

My goal was to be able to map the "DELETE ROWS" tool to one of the Function Keys which I have been successful in doing, but the thing is as we all know once you use a macro it cannot be undone.

My question is does anyone by any chance have an already made "DELETE ROWS" macro that contains the proper coding to UNDO the command? Or know of any other way to map this tool to a Function Key and be able to UNDO the command if a mistake is made?

Thank You to anyone who reads this
 
@Michael...agreed, I never would use that in lieu of having the macro work correctly. I definitely use msgbox/input boxes to warn or guide if the macro will be used by others. But I will need to look into error trapping so that I am more familiar with what that is; although, if aptly named, I do understand the basics of that.

Thank you so much for taking the time to offer guidance. I pick random threads to read all the time and learn from what others are asking so when I come to an unknown scenario I am better equipped to learn how to overcome the obstacles at hand.
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Mate....that's why we all come here....to help each other...(y)
 
Upvote 0
@lrobbo314
I could have sworn I responded to your response but I just released it didn't show up here.
Thank You so much for your response, that is a very interesting macro you found / provided.
I don't understand it coding wise at all :) but it actually works.
As you mention it is weird though, because it does not work to undo all macros.
The more complex the macro, the less likely it will work, but I have also run some very simple macros that it does not undo, so it is hard to tell what it will and won't work with.
I wish I could understand it a little better, so I would know what to trust it with and what not to, but wow when it does work it really is amazing.
I am so used to not being able to undo after using macros that it still amazes/shocks me each time when I witness it actually undo a macro.

Thank You again for providing this and Thank You to whoever created this, very cool.
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,892
Members
449,058
Latest member
Guy Boot

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