Automating Repetitive Tasks with Macros

graphics/15inf04.jpg

graphics/one_icon.jpg

Open the Tools menu and select Macro, Record New Macro to open the Record Macro dialog box.

graphics/tow_icon.jpg

In the Macro Name field, type a descriptive name for the macro something you will easily remember (for example, Quarter) and click OK.

graphics/three_icon.jpg

Office begins recording your actions; all actions will be performed by the macro when it is run. In this case, click the New button to create a new workbook.

graphics/foure_icon.jpg

Add and format any text that you want automatically placed in each new workbook the macro creates.

INTRODUCTION

If your job requires you to use your computer to perform repetitive tasks, you can probably use Office to create a macro to automate those tasks. For example, suppose you frequently create quarterly workbooks. You could create a macro that automatically opens a new blank workbook and adds the appropriate column heading information, as outlined in this task. You can create macros that accomplish just about any task in any Office application without knowing anything about programming. You simply use Office's macro-recording feature to record the actions of a particular task; then, when you run the macro, Office performs these actions for you.

TIP

Macro Security

Before you run a macro, make sure you know who a macro is from and that it is a trusted source. To be extra careful, select Tools, Macro, Security to open the Security dialog box. Make sure the security level is set to High.

graphics/15inf05.jpg

graphics/five_icon.jpg

When you've completed all the actions you want the macro to perform, click the Stop Recording button.

graphics/six_icon.jpg

To run the macro you created, open the Tools menu and select Macro, Macros (or press Alt+F8 ) to open the Macro dialog box.

graphics/seven_icon.jpg

Double-click the macro's name to run it. (Notice that the macro's name contains the name of the workbook you were using when the macro was created.)

graphics/eight_icon.jpg

Office runs the macro in this case, automatically creating a new workbook and adding and formatting the text you specified.

TIP

Everything Records

Keep in mind that when the macro is recording, everything you do is recorded. For example, if you page down through a worksheet, that will happen when you run the macro later.

TIP

Adding Macros to Your Toolbars

You can add macros to your toolbars to make it easy to launch them. To do so, click the More Buttons arrow on the right side of the Standard toolbar and then click the Add or Remove Buttons command. Select the Commands tab on the Customize dialog box, and select Macros from the Categories list. Then select the macro for which you want to create a button in the Commands list.



Easy Microsoft Office 2003
Easy Microsoft Office 2003
ISBN: 0789729628
EAN: 2147483647
Year: 2003
Pages: 281
Authors: Nancy Lewis

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net