iFocus.Life News News - Breaking News & Top Stories - Latest World, US & Local News,Get the latest news, exclusives, sport, celebrities, showbiz, politics, business and lifestyle from The iFocus.Life,

How to Create a Word Macro to the End of a Document

104 45

    Add Developer Tab in Word 2010

    • 1). Open Microsoft Word. Click "File" and select "Options. "

    • 2). Click "Customize "Ribbon" and put a check mark next to "Developer.

    • 3). Click "OK." Word will add the "Developer" tab to the ribbon at the top of the screen.

    Add Developer Tab in Word 2010

    • 1). Open Word and click the "Office" button at the top of the screen.

    • 2). Select "Word Options" and then select "Popular."

    • 3). Select "Show Developer Tab in the Ribbon" and click "OK." Word will add the "Developer" tab to the ribbon.

    Create Macro

    • 1). Press "ALT+F8." The "Macro" window will open. Type a name for the macro in the "Macro Name" text box. Use a descriptive name that has no spaces. For example, you might name it "EndOfDocument."

    • 2). Click "Create." The VBA editor will open and display a blank subroutine. A subroutine is a block of code that performs a task. In this instance, this subroutine will execute the instructions for the macro that you created. The subroutine skeleton will look similar like this:

      Sub xyz()

      End Sub

      The name of the sub will not be "xyz." It will instead contain the macro name that you entered in the "Macro Name" text box.

    • 3). Paste the following code after the "Sub" statement:

      Selection.EndKey Unit:=wdStory, Extend:=wdMove

    • 4). Click the "X" button at the top right corner of the VBA editor window to close the window and return to Word's main screen.

    • 5). Open a document that has several pages and position the mouse cursor on the first line.

    • 6). Press "ALT+F8" to open the "Macro" window. Highlight the macro that you created and click "Run." It will execute and move to the end of the document.

Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time
You might also like on "Technology"

Leave A Reply

Your email address will not be published.