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

Viewing Footnotes

Adding footnotes to a document is essential for some types of writing. How you view those footnotes depends on the display ...

Discover More

Occurrences of a Text String within a Document

You may have a need to find out how many times a certain text string occurs within a document. You can find out manually ...

Discover More

Counting Only Money Winners

If a series of cells contain the amount of money won by individuals, you may want to count the number of individuals who ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (ribbon)

Dissecting a String

Want to pull a string apart in a macro? It's easy using the string functions introduced in this tip.

Discover More

Offering Options in a Macro

When creating macros, you often need to offer a series of choices to a user. This tip demonstrates how easy it is to offer ...

Discover More

Deleting a Macro

ScreenTips can appear with or without shortcut keys displayed in them. Here's how to control whether they appear or not.

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 6 + 0?

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.