Browse Sections

Microsoft Excel Power

Lesson 1: The basics of Macros.

Why use macros?

A macro enables you to repeat operations that you would normally do by hand, but it is much faster, and when written correctly, much more reliable. Often, a macro will enable you to do things that would be very difficult by hand, if not impossible. Most of all, writing macros should be a fun and interesting activity and you will be amazed at how quickly your abilities to perform wondrous things in Excel will increase.

You will soon be known throughout your office as the "Macro Wizard!" Granted, as important as this title is, it may not guarantee an increase in salary or promotion, but you never know! The thing to remember as you embark on this quest to learn about macros is: be prepared to make mistakes. If you are not making mistakes, then you are not learning! I have made every mistake that can be made, and some that were previously thought impossible to make. Okay, let's get to it.

Getting into the environment [workbook used: Lesson 1.xls]

The first example that we will consider relates to a report produced out of a system. This report provides important information relating to projects and its audience is management. While it is nice that the system process can produce this report, the look of its output is a little less than desired.

The first tab in the Lesson 1.xls {Unformatted Report} shows just the heading lines of the report. Pretty poor looking don't you think? It has all of the relevant information, but it just looks very unprofessional. I mean, what is the deal with the "########" in cells I1 and I2? (As you probably have guessed, the field is not initially wide enough for the data to display correctly.)

Now, we are going to look at this example in more detail in a later lesson (we will format the whole report and manipulate some of the data), but for now, let's just focus on what we would do for these unfortunate titles.

The desired result is shown in the second tab {Formatted Report}. I think that you will agree it is a lot better. It certainly makes it easier to read.

Print this Page Print this page


Previous Page  1  2  3  4  5  6   Next Page