ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Undo a Macro? (https://www.excelbanter.com/excel-programming/362278-undo-macro.html)

[email protected]

Undo a Macro?
 
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


Norman Jones

Undo a Macro?
 
Hi Ken,

See John Walkenbach at:

http://www.j-walk.com/ss/excel/tips/tip23.htm


---
Regards,
Norman


wrote in message
ps.com...
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





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

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