Note: the same process should work in most versions of Microsoft Office.

The screenshots might look slightly different.

What is a Macro?

Learn How to Use Excel Macros to Automate Tedious Tasks

For a comparable analogy, think of a document as HTML and a macro as Javascript.

Macros are incredibly powerful and can do pretty much anything your imagination can conjure.

Our goal is to produce a well formatted, presentable data sheet which includes summary totals for each row.

image

To create a macro, go to View > Macros > Record Macro.

There are a couple of places which indicate Excel is record mode.

One is by viewing the Macro menu and noting that Stop Recording has replaced the option for Record Macro.

image

The other is in the bottom right corner.

Now that we are recording our macro, let’s apply our summary calculations.

First add the headers.

image

Once this is done, each row should display their respective summaries.

Congratulations - you have just created an Excel macro.

To do this, select all cells and delete them.

image

when you land saved the file as a template, go ahead and close Excel.

For example, a macro could alter or delete random files in your My Documents folder.

As such, it is important to see to it you only run macros from trusted sources.

image

To put our data format macro to use, launch the Excel Template file which was created above.

Because we trust a macro created by ourselves, smack the ‘Enable Content’ button.

delimiter, headers present, etc.).

image

In the resulting dialog box, we see the “FormatData” macro we recorded above.

Select it and click Run.

When all is said and done, it should look just like our original - except with different data.

image

To view the code that makes our macro run, from the Macros dialog tap the Edit button.

The window that opens displays the source code that was recorded from our actions when creating the macro.

Download Excel Macro Template from How-To Geek

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

Windows