Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Undoing a VBA Macro in word

Status
Not open for further replies.

moontho

Technical User
Jun 4, 2003
85
GB
I'm trying to find a way for a user to undo a macro in word without having to press the undo button loads of time. Is there a way for VBA to remember what it's done, but not list loads of "VBA" entries in the undo dropdown?

Many thanks

thom
 

You could create an undo macro that repeats the original macro in rverse but the easiest thing to do is to close and re-open the doc without saving.
 

dhulbert's SECOND suggestion is your best option.

1. UNDO will not work after a VBA procedure executes.

2. Think about this: Your VBA procedure replaces the string, any one with people. So, you would conclude, if I REVERSE the process and replace people with any one everything would be cool! RIGHT?

Well, what about the instances where you had both people AND any one PRIOR to the running of the procedure. Those are the kinds of things that you have to consider when writing your own UNDO procedure.

Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
You should also consider WHY you may have this problem. If you have a VBA procedure, must be specifically called and run - if you need to reverse it, why must you run it in the first place?

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top