Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, and 2013. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Repeating Actions.

Repeating Actions

by Allen Wyatt
(last updated April 12, 2014)

2

If you want to repeat an action a single time, you can either press the F4 key or Ctrl+Y. What if you want to repeat it more than once, however? Granted, you could press these keys multiple times, but this can get tedious if you want to repeat something fifty or sixty times.

The answer is to use a nifty little macro that will do the repeating for you:

Sub DoRepeat()
    Dim CountValue As Integer
    CountValue = Val(InputBox("How many times?"))
    If CountValue > 0 Then Repeat (CountValue)
End Sub

The trick is to assign DoRepeat to a keyboard shortcut, such as Alt+R. Then, you can perform an action, press Alt+R, enter the number of times to repeat, and be on your way. You should note that if the action you did prior to invoking the macro cannot be repeated for some reason, you will get an error when the macro tries to run.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9081) applies to Microsoft Word 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Word here: Repeating Actions.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Modifying Behavior of the Open Dialog Box

The Open dialog box is one that few of us think about, but you can control how it behaves with a little bit of macro ...

Discover More

Don't Update Links to Other Programs

If you have links in your workbook to data in other workbooks, you may want to control whether Excel updates those links ...

Discover More

Making Backup Copies

When you save your documents, Word doesn't normally make backups of your files. If you want the program to do that, it ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Understanding the If ... End If Structure

One of the powerful programming structures provided in VBA allows you to conditionally execute commands. The If ... End ...

Discover More

Adding Parentheses

Need to add parentheses around some word or phrase? Here's a quick macro that makes this simple edit in one step.

Discover More

Deriving an Absolute Value

Want to know the absolute value of a number? It's easy to derive in VBA by using the Abs function.

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 9 + 6?

2016-09-20 05:46:35

Tango

There's a ghost in my machine. My delete and backspace keys repeat at random times, swallowing everything forwards or backwards in my novel. My only save is to yank out my USB or hope ctl-alt-del gets me to the task manager in time to end the program. Im using MsWord2010 and had 2 different computers and 2 diff manuscripts with the same prob. Obviously, its me doing something clumsy. I've disabled insert and over write. Anybody have a fix or notion of what I'm repeatedly doing wrong?


2014-12-08 17:29:38

Doug Carlile

I have a document with about 3600 records, each record on a separate page. I have a macro that adds blank lines so the data will fit a form. My Macro is currently assigned to Alt+/ and in order to process the file (every record gets the exact same treatment) I have to hold the Alt & / keys. When I tested this macro, it did not repeat macro #1, but repeated the last action in macro #1.

Can someone tell me what I am doing wrong?

Thanks,
Doug Carlile


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.