Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

5 essential tips for creating Excel macros

JD Sartain | Feb. 18, 2015
Excel macros save you time and headaches by automating common, repetitive tasks. And you don't have to be a programmer or know Visual Basic Applications (VBA) to write one. With Excel 2013, it's as simple as recording your keystrokes. Use these tips to make macro recording a cinch.

In the April Report example, you wouldn't combine the calculation macro with the format macro. You'd use one macro to combine all the branch workbooks into one final spreadsheet, a second macro to calculate the data, a third macro to format the spreadsheet, a fourth macro to create charts, and perhaps a fifth macro to print.

If a macro fails, you can troubleshoot it by stepping through it one line at a time. It's like slow motion, only you control each time the next event occurs using the F8 key. Click Developer>Macro, select your macro from the list, then click the Step Into button. Shrink the Code window down and place it on the bottom right side of the screen so you can see your spreadsheet behind it. Press F8 each time you want the macro to proceed to the next step. The macro stops when it reaches the error. You can then repair the error or record a new macro.


Previous Page  1  2 

Sign up for CIO Asia eNewsletters.