Читать книгу Excel Macros For Dummies - Dick Kusleika - Страница 14

Editing the macro

Оглавление

After you record a macro, you can make changes to it. The macro you recorded in the previous section always inserts your name into cell B3. Edit the macro so that it enters your name in whatever cell you happen to be in when you run it. To do that, delete the first and third lines of the macro. The edited macro appears as follows:

Sub MyName()'' MyName Macro'' Keyboard Shortcut: Ctrl+Shift+N' ActiveCell.FormulaR1C1 = "Dick Kusleika"End Sub

This macro inserts text into the active cell because the first Select statement was removed. That same cell remains active because the second Select statement was removed.

Excel Macros For Dummies

Подняться наверх