Главная » Excel Macros For Dummies читать онлайн | страница 31

Читать книгу Excel Macros For Dummies онлайн

31 страница из 60

3 Select the AddTotalRelative macro.

4 Click the Run button.

5 Select cell F1.

6 Click Macros on the Developer tab.

7 Select the AddTotalRelative macro.

8 Click the Run button.

Notice that this macro, unlike your previous macro, works on both sets of data. Because the macro applies the totals relative to the currently active cell, the totals are applied correctly.

For this macro to work, you simply need to ensure that

 You’ve selected the correct starting cell before running the macro.

 The block of data has the same number of rows and columns as the data on which you recorded the macro.

Hopefully, this simple example has given you a firm grasp of macro recording with both absolute and relative references.

Understanding Macro Security

At this point, you should feel comfortable recording your own Excel macros. In the wrong hands, macros can be destructive. Because macros are so powerful, some people have used them to create macro viruses that can be harmful to your computer. For that reason, Microsoft has built some security measures around macros. Here are some important security concepts you need to keep in mind when working with macros.

Правообладателям