Saturday, April 9, 2011

MS Excel 2007 - How to Create a Simple Macro That Will Help You Save Time

This article will explain how create a simple macro that will help you save time. If you use MS Excel 2007, you probably realize how easy it is to filter and manipulate data. Formatting that data can take a little time if you have a lot of changes to make. But if you are always formatting the same report, there's no need to waste all that time.

Recording a macro is easy, and it will let you get the exact same results every time you run it. It's a great feature that is in many versions of Excel. But these instructions apply only to Excel 2007.

Here's how you do it:
When you create your macro, you'll need to past the data you intend to format on a worksheet in the workbook. In the View tab on the ribbon, find the section called Macros. Click the lower portion of the button and select Record Macro. The Record Macro dialog box will appear. You'll need to give your macro a name. Any name will do, but you can't have any spaces or unusual characters. It's kind of like naming a file. Make it something you'll remember. Once you choose a name you can decide if you want to be able to activate the macro with a key stroke combination. Add the letter you want to use. Of course you have to stay away from letters that are already in use, like Ctrl + C or any of the numerous shortcuts already programmed into Excel. Choose the default option to store the macro in This Workbook. Until you get a little more comfortable with macros you'll want to use this option. Later you can learn how to keep your macros in a Personal Workbook that Excel will create for you. Click "OK" and from that point on every key stroke and mouse click you make will be recorded in the macro. Make all the changes you want to make to make your data more readable. You can format the header row, the columns, and even individual cells. You can even set up your print options including the Header and Footer. Any thing you do in Excel will be recorded and can be "played back" whenever you want. Once you've made all the changes, go back to the View section on the ribbon and click the bottom half of the Macro button. You'll see the option to stop recording. Click on that and you're done. To test your macro copy your unformatted data from the original report and paste it into the workbook on a new worksheet. Then, click the Macro button again. Select View Macros and you'll see your macro listed in the Macro dialog box. Highlight the macro name and click Run. Then you'll see your macro at work! If it's a short macro it may run so fast that you can barely keep up with the action. Presto! You just saved yourself the time it takes doing the same formatting tasks every time you need that report. If you don't like how the macro turned out, you can delete it and start over. Just highlight the macro in the Macro dialog box and click Delete.

The final step to make the workbook ready to go every time you need it. First, delete the worksheets you have already formatted, then save the workbook. That's it! Now, every time you run your report, just paste the data into the workbook and run your macro. It's amazing!

No comments:

Post a Comment