Macro definition cho windows 10

Word for Microsoft 365 Word for the web Word 2021 Word 2019 Word 2016 Word 2013 Word 2010 Word 2007 More...Less

In Word, you can automate frequently used tasks by creating and running macros. A macro is a series of commands and instructions that you group together as a single command to accomplish a task automatically.

To save time on tasks you do often, bundle the steps into a macro. First, you record the macro. Then you can run the macro by clicking a button on the Quick Access Toolbar or pressing a combination of keys. It depends on how you set it up.

  1. Click View > Macros > Record Macro.

    Macro definition cho windows 10

  2. Type a name for the macro.

    Macro definition cho windows 10

  3. To use this macro in any new documents you make, be sure the Store macro in box says All Documents (Normal.dotm).

    Macro definition cho windows 10

  4. To run your macro when you click a button, click Button.

    Macro definition cho windows 10

  5. Click the new macro (it’s named something like Normal.NewMacros.<your macro name>), and click Add.

    Macro definition cho windows 10

  6. Click Modify.

    Macro definition cho windows 10

  7. Choose a button image, type the name you want, and click OK twice.

    Macro definition cho windows 10

  8. Now it’s time to record the steps. Click the commands or press the keys for each step in the task. Word records your clicks and keystrokes.

    Note: Use the keyboard to select text while you’re recording your macro. Macros don’t record selections made with a mouse.

  9. To stop recording, click View > Macros > Stop Recording.

    Macro definition cho windows 10

The button for your macro appears on the Quick Access Toolbar.

Macro definition cho windows 10

To run the macro, click the button.

  1. Click View > Macros > Record Macro.

    Macro definition cho windows 10

  2. Type a name for the macro.

    Macro definition cho windows 10

  3. To use this macro in any new documents you make, be sure the Store macro in box says All Documents (Normal.dotm).

    Macro definition cho windows 10

  4. To run your macro when you press a keyboard shortcut, click Keyboard.

    Macro definition cho windows 10

  5. Type a combination of keys in the Press new shortcut key box.

  6. Check to see whether that combination’s already assigned to something else. If it's already assigned, try a different combination.

  7. To use this keyboard shortcut in any new documents you make, be sure the Save changes in box says Normal.dotm.

  8. Click Assign.

  9. Now it’s time to record the steps. Click the commands or press the keys for each step in the task. Word records your clicks and keystrokes.

    Note: Use the keyboard to select text while you’re recording your macro. Macros don’t record selections made with a mouse.

  10. To stop recording, click View > Macros > Stop Recording.

    Macro definition cho windows 10

To run the macro, press the keyboard shortcut keys.

To run a macro, click the button on the Quick Access Toolbar, press the keyboard shortcut, or you can run the macro from the Macros list.

  1. Click View > Macros > View Macros.

    Macro definition cho windows 10

  2. In the list under Macro name, click the macro you want to run.

  3. Click Run.

To make a macro from one document available in all new documents, add it to the Normal.dotm template.

  1. Open the document that contains the macro.

  2. Click View > Macros > View Macros.

    Macro definition cho windows 10

  3. Click Organizer.

    Macro definition cho windows 10

  4. Click the macro you want to add to the Normal.dotm template, and click Copy.

  1. Click File > Options > Customize Ribbon.

  2. Under Choose commands from, click Macros.

  3. Click the macro you want.

  4. Under Customize the ribbon, click the tab and custom group where you want to add the macro.

If you don't have a custom group, click New Group. Then click Rename and type a name for your custom group.

  1. Click Add.

  2. Click Rename to choose an image for the macro and type the name you want.

  3. Click OK twice.

  1. On the Developer tab, in the Code group, click Macros.

  2. In the Macro name box, type a name for the macro.

    Note: If you give a new macro the same name as a built-in macro in Word, the new macro actions will replace the built-in macro. To view a list of built-in macros, click Word Commands in the Macros in list.

  3. In the Macros in list, click the template or document in which you want to store the macro.

    To make your macro available in all documents, be sure to click Normal.dotm.

  4. Click Create to open the Visual Basic Editor.

After you open the Visual Basic Editor, you may want more information about working with Visual Basic for Applications. For more information, click Microsoft Visual Basic Help on the Help menu or press F1.

You can record a sequence of actions, or you can write a macro from scratch by entering Visual Basic for Applications code in the Visual Basic Editor.

Note: To work with macros in Office Word 2007, you need to show the Developer tab.

  1. Click the Microsoft Office Button

    Macro definition cho windows 10
    , and then click Word Options.

  2. Click Popular.

  3. Under Top options for working with Word, select the Show Developer tab in the Ribbon check box.

    Note: The Ribbon is a component of the Microsoft Office Fluent user interface.

  1. On the Developer tab, in the Code group, click Record Macro.

    Macro definition cho windows 10
  2. In the Macro name box, type a name for the macro.

    Note: If you give a new macro the same name as a built-in macro in Office Word 2007, the new macro actions will replace the built-in macro. To view a list of built-in macros, on the Developer tab, in the Code group, click Macros. In the Macros in list, click Word Commands.

  3. In the Store macro in box, click the template or document in which you want to store the macro.

    Important: To make your macro available in all documents, be sure to click Normal.dotm.

  4. In the Description box, type a description of the macro.

  5. Do one of the following:

    • Begin recording    To begin recording the macro without assigning it to a button on the Quick Access Toolbar or to a shortcut key, click OK.

    • Create a button    To assign the macro to a button on the Quick Access Toolbar, do the following:

      1. Click Button.

      2. Under Customize Quick Access Toolbar, select the document (or all documents) for which you want to add the macro to the Quick Access Toolbar.

        Important: To make your macro available in all documents, be sure to click Normal.dotm.

      3. Under Choose commands from dialog box, click the macro that you are recording, and then click Add.

      4. To customize the button, click Modify.

      5. Under Symbol, click the symbol that you want to use for your button.

      6. In the Display name box, type the macro name that you want to display.

      7. Click OK twice to begin recording the macro.

        The symbol that you choose is displayed in the Quick Access Toolbar. The name that you type is displayed when you point to the symbol.

    • Assign a keyboard shortcut    To assign the macro to a keyboard shortcut, do the following:

      1. Click Keyboard.

      2. In the Commands box, click the macro that you are recording.

      3. In the Press new shortcut key box, type the key sequence that you want, and then click Assign.

      4. Click Close to begin recording the macro.

  6. Perform the actions that you want to include in the macro.

    Note: When you record a macro, you can use the mouse to click commands and options, but not to select text. You must use the keyboard to select text. For more information about selecting text by using the keyboard, see Select text.

  7. To stop recording your actions, click Stop Recording in the Code group.

Change the keyboard shortcut for a macro

  1. Click the Microsoft Office Button

    Macro definition cho windows 10
    , and then click Word Options.

  2. Click Customize.

  3. Next to Keyboard shortcuts, click Customize.

  4. In the Categories list, click Macros.

  5. In the Macros list, click the macro that you want to change.

  6. In the Press new shortcut key box, type the key combination that you want to choose.

  7. Check the Current keys box to make sure that you aren't assigning a key combination that you already use to perform a different task.

  8. In the Save changes in list, click the option that matches where you want to run your macro.

    Important: To make your macro available in all documents, be sure to click Normal.dotm.

  9. Click Close.

  1. On the Developer tab, in the Code group, click Macros.

    Macro definition cho windows 10

  2. In the list under Macro name, click the macro that you want to run.

  3. Click Run.

  1. On the Developer tab, in the Code group, click Macros.

    Macro definition cho windows 10

  2. In the Macro name box, type a name for the macro.

    Note: If you give a new macro the same name as a built-in macro in Office Word 2007, the new macro actions will replace the built-in macro. To view a list of built-in macros, click Word Commands in the Macros in list.

  3. In the Macros in list, click the template or document in which you want to store the macro.

    To make your macro available in all documents, be sure to click Normal.dotm.

  4. Click Create to open the Visual Basic Editor.

After you open the Visual Basic Editor, you may want more information about working with Visual Basic for Applications. For more information, click Microsoft Visual Basic Help on the Help menu or press F1.

To make quick work of tasks that you do often, in the desktop version of Word you can bundle the steps into macros that run with a single click. In Word for the web, you have to step through such tasks manually.

If you have Word, first click Open in Word to open your document in Word.

Macro definition cho windows 10

Then follow the instructions for the desktop version of Word.

When you run the macro in Word and save the document, you’ll see the results of the macro when you reopen your doc in Word for the web.

Need more help?

Does Windows 10 have a built in macro recorder?

Unfortunately, Windows does not come with a built-in macro recorder. On the bright side, you can use many third-party macro recorder software from the internet. Windows macro recorder programs like Macro Recorder and Macro Scheduler are perfect for this purpose.

What is a macro in MS Word?

In Word, you can automate frequently used tasks by creating and running macros. A macro is a series of commands and instructions that you group together as a single command to accomplish a task automatically.

How do I run a macro in Windows 10?

Run a macro by pressing a combination shortcut key In the Macro name box, click the macro that you want to assign to a combination shortcut key. Click Options. The Macro Options dialog box appears. In the Shortcut key box, type any lowercase or uppercase letter that you want to use with the shortcut key.

Where is the Macro Recorder in word?

To record a macro, select “Record Macro,” found on the Developer tab. You can give your macro any name that you'd like, as long as there are no spaces in the name. The “Store macro in” dropdown menu gives you the option to save the macro to all future Word documents or only to documents based on your template.

What is macro in MS Excel explain?

If you have tasks in Microsoft Excel that you do repeatedly, you can record a macro to automate those tasks. A macro is an action or a set of actions that you can run as many times as you want. When you create a macro, you are recording your mouse clicks and keystrokes.

What is macro in MS Word PDF?

Macros enable you to automate routine operations and tasks in Microsoft programs. A macro is a small program that records the actions you take to complete a specific task, for example, adjusting the page layout to a specific format. You then run the macro to apply all of the recorded actions in just a single click!