![]() ![]() Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback. For more information, see Revising Recorded Visual Basic Macros. You can, however, modify the recorded macro to work with Range objects. The following code example indents the selected paragraphs by one-half inch. To record a macro and assign a shortcut key to it To do this in Word 2010 or Word 2007, on the View tab, click the lower part of the Macros botton, and then. Start by going to the View tab and clicking the Record Macro button. this gave me the code below, but I get everything to work I need to find out how to select a picture in VBA. My work around for this was to select the picture before recording the macro and then select the picture command from the Format menu. Just to change things up a bit, lets start at cell B5. So, Ill clear these cells, and turn on Use Relative References. Well, I know I need to record a new macro. ![]() Recorded macros use the Selection object. I have tried to record a macro, but the the macro recorder does not allow me to select a picture. By using relative references, the macro will build a series by selecting the active cell and 6 cells to its right, instead of building a series using A1 through G1. LeftIndent and press F1 or click the Help button. Now click on the 'Macros drop down list ' and choose 'Record Macro'. Open you Word document and click on the 'View Tab'. View the Visual Basic code to determine the property that corresponds to the left paragraph indent (the LeftIndent property). To implement a macro use the following procedure. Select the macro name that you assigned in Step 2 and click Edit. As such using the macro recorder is the simplest way to create a macro that can reproduce exactly those actions. On the Developer ribbon, click Stop Recording. The macro recorder provided with Excel and Word allows you to record the actions on your workbook or document-interpreted as a sequence of VBA statements. On the Home menu, click the Increase Indent button. On the Developer ribbon, click Record Macro.Ĭhange the default macro name to a name of your choice and click OK to start the recorder. Word displays the Record Macro dialog box. To record a macro, follow these steps: Display the Developer tab of the ribbon. You can then start and stop recording using the Macro Recording icon there. For example, if you don't know what property or method to use to indent a paragraph, do the following: If you have a repetitive task that is a good candidate for a macro, you can use the macro recording capabilities of Word to help turn your actions into a macro. To do so, right-click in the Status Bar and select Macro Recording. ![]() After you record your actions, you can modify the code to do exactly what you want. The macro recorder translates your actions into Visual Basic code. If you are unsure of which Visual Basic method or property to use, you can turn on the macro recorder and manually perform the action. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |