Microsoft Excel Macros Course
Course Description
You will write and edit macros for Excel, using Visual Basic for Applications and the Integrated Development Environment.
Upon successful completion of this course, students will be able to:
- Create new macros and edit existing ones
- Assign those macros to toolbar buttons and to get them to run automatically
- Create sub procedures to interact with the user, asking for information and returning information
- Format a worksheet, including text, cell borders and shading and use custom number formats through VBA
- Enter data in cells and retrieve data from cells programmatically
- Assign headers and footers programmatically and work with workbook properties
- Create code loops to iterate through sheets in a workbook or cells in a range, in order to process each item in them in similar ways
- Create programmatic tests and have the code respond in different ways depending on the outcomes of those tests
Delivery Method: Instructor led, group-paced, classroom-delivery learning model with structured hands-on activities.
Course pre-requisites:
To effectively understand this course, we recommend that you take the Microsoft Excel Level 1, Level 2 and Level 3 courses, or have equivalent experience.
Topics covered on the 2 day Microsoft Excel Macros course
Part 1: Basics of writing VBA
Part 2: Selecting objects and setting values
- Overview
- Properties and methods
- Named vs Positional arguments
- Examples of Properties and Methods
- Exercise – selecting cells and inserting data
Part 3: Setting format properties
- Exercise – adding formatting to a worksheet
Part 4: Using variables to store information
- Data types for variables
Part 5: Interacting with the user
- Using an InputBox to get information
- Some examples of using the InputBox function
- Exercise 3 – Using InputBoxes to automate headers and footers
Code for Exercise 3
- Using a MsgBox
- Using a MsgBox to give information to the user
- Using a MsgBox to get information from the user
- Exercise 4 – Using MsgBox functions
- Exercise 5 – Using InputBoxes, MsgBoxes and functions
Part 6: Branching and looping
- The IF block
- Exercise 6 – Using IF…ELSE…END IF
- Select case
- Using SELECT CASE to test a single conditional against multiple outcomes
- Exercise 7 – Using Loops
- Exercise 8 – Using DO…LOOP
Part 7: Object Variables and FOR EACH… NEXT loops
- Exercise 9 – Using object variables
- Using the UNION function and multiple object variables
- Exercise 10 – Putting it all together
Course Classification:
Applications Training Course
This is an instructor led training course taught in a classroom based environment.
Scheduled course dates
| March 2010 | April 2010 | May 2010 | June 2010 | July 2010 |
| 15-16 | 26-27 | - | 1-2 | - |
View full schedule of Microsoft Excel courses
View full schedule of VBA courses
Print / Download PDF Version of full course schedule
If you would prefer to run this course at your premises as you have several employees to place on the course perhaps, then we are also able to offer onsite Microsoft Excel Training and bespoke Microsoft Excel courses
The Microsoft Excel Macros course qualifies for the PTR Training Passport SAVE IT Scheme, which offers discounts on bookings for multiple courses and/or multiple delegates.

