Automating Tasks Using Macros

Lesson Transcript
Instructor: Paul Zandbergen

Paul is a GIS professor at Vancouver Island U, has a PhD from U of British Columbia, and has taught stats and programming for 15 years.

Computer users often have to perform repetitive tasks. A macro is a set of computer instructions that you can record and execute later as needed. Learn how to use macros to automate workflows and save time.

Repetitive Tasks

Computers are great for carrying out tasks that would otherwise be tedious or impossible. Just think of having to type out a report using a typewriter or doing complex calculations by hand using pencil and paper. In many ways, computers have made our lives easier. However, many computer users still often perform very repetitive tasks, such as filling in forms or typing out memos. In this lesson, we will look at some ways to change that.

Let's say you are a financial analyst working for a large financial services firm. One of your tasks is to brief your team members on the latest market conditions. Every day at 8:00 a.m. you sit down at your desk, and you go through the same routine.

You log on to your computer, and you visit about 10 different financial websites. From each site, you download a report or copy some selected financial indicators. You put all this information into a spreadsheet, and you've come up with some clever formulas to describe the present market conditions based on the raw data. You send out this summary report to all your team members at 9:00 a.m. so they can refer to it throughout the day.

You have become very efficient at producing this report, but the websites change their reports daily, and it just takes one hour to get all the information collected, organized and analyzed. What if there was a way for you to have this report done, not at 9:00 a.m., but at 8:01 a.m.? Now that would be cool. What you need is a macro.

An error occurred trying to load this video.

Try refreshing the page, or contact customer support.

Coming up next: Presentation Software & Graphic Suites: Purpose & Examples

You're on a roll. Keep up the good work!

Take Quiz Watch Next Lesson
Your next lesson will play in 10 seconds
  • 0:05 Repetitive Tasks
  • 1:52 What Is a Macro?
  • 2:54 Types of Macros
  • 5:15 Considerations when…
  • 6:31 Marcos vs. Programming
  • 7:58 Lesson Summary
Save Save Save

Want to watch this again later?

Log in or sign up to add this lesson to a Custom Course.

Log in or Sign up

Speed Speed

What Is a Macro?

A macro is a set of computer instructions that you can record and execute later as needed. You carry out the particular steps once, and the sequence of steps is recorded. You then associate the steps with a shortcut key combination or a macro name. When you press the shortcut key combination or click the macro name, your computer program carries out the same instructions that were previously recorded. This can save a significant amount of time by replacing a series of frequently used actions with one much shorter action.

Macros have a number of potential benefits, including:

• Automate repetitive computer tasks

• Carry out tasks faster than a human computer user

• Complete tasks more reliably without human errors

• Reduce stress and boredom of computer users

Types of Macros

Broadly speaking, there are two types of macros of interest. The first one is called an application macro. This is a macro that is recorded and executed within a single software application. A good example of this would be a spreadsheet application, like Microsoft Excel. Spreadsheets contain many functions for processing of numerical data, but you will often need to create your own sequence of processing and analysis steps. This could be as simple as typing in a series of numbers or as complex as a predictive statistical model.

Within the software application, you start recording your macro, carry out your steps, and stop recording. When you run the macro the next time, it will carry out the exact same steps. The ability to record and run macros is a built-in function of the software application.

Technically speaking, the software converts your steps to instructions written in a particular programming language that works with the software. Which language is used will depend on the software application. Microsoft Office applications have traditionally used Visual Basic for Application, or VBA, as the default language for creating macros.

The second type is a generic macro that works at the operating system level. This means you are not limited to one software application. Your macro can be used to open a web browser, go to a website, download a file, open this file up in an application and then manipulate the data. This starts to look like the type of macro our financial analyst wants to use.

This type of macro typically requires a specialized software application created for the specific purpose of creating macros. This type of software is sometimes referred to as automation software. Both types of macros use the same logic: your record a series of steps that are saved for later execution. The series of steps can be executed on demand with a single button-click.

To unlock this lesson you must be a Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use

Become a member and start learning now.
Become a Member  Back
What teachers are saying about
Try it now
Create an account to start this course today
Used by over 30 million students worldwide
Create an account