Undo a Macro?

K

kk_oop

Hi. I defined a macro that will copy the current row and do a copy
insert. It looks like this:

Sub CopyInsert()

ActiveCell.EntireRow.Select
Selection.Copy
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False

End Sub

This works well. The problem is that after I run the macro, I can't
undo the changes. It seems to clear the undo buffer. Is there some
code I can include in the macro to enable the command to be undone
after it is run?

Thanks!

Ken
 

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

Similar Threads

Need Help with Macro Security 1
Macro Loop 0
undo a macro 1
Keeping formulas on an insert 1
VBA Coding Help for Beginner 0
insert a line 1
Cleanup this macro please 3
Changes in How Code Acts After Upgrade of Excel 2

Top