Course Details
Course Code: VBA001; Duration: 2 days; Instructor-led
This course provides an introduction to programming for students with little or no prior programming experience. Through this course, students will gain a strong, accessible, hands-on foundation in the language skills needed for learning Visual Basic for Applications (VBA) under MS-Excel environment.
The knowledge and skill gained from this course can be applied to MS-Excel 2003, MS-Excel 2007, MS-Excel 2010 and MS-Excel 2013.
This is the entry level course for more advanced Excel VBA programming.
This course introduces students to the techniques used in the key areas of computer programming:
- Programming principles
- Basic program control structures
- Data types
- Subroutines and Functions
At the end of the course, students will be able to start creating simple VBA solution by using MS-Excel.
Audience
Any Microsoft Excel users whoever want to do extra ordinary thing from their Microsoft excel applications where but limited by the predefined features. This includes those who know nothing about computer programming.
Prerequisites
Before attending this course, students must be able to demonstrate the following skills:
- Ability to use a computer keyboard and a mouse.
- Familiarity with the general operations of Microsoft Windows operating system.
- Basic knowledge and skill in using Microsoft-Excel (Any version).
The course materials, lectures, and lab exercises are in English. To benefit fully from the instruction, students need an understanding of the English language and completion of the prerequisites.
Methodology
This program will be conducted with interactive lectures, PowerPoint presentation, discussions and practical exercise.
Course Objectives
Upon completion of this program, participants should be able to:
- Enhance your productivity using ribbons in PowerPoint
- To move beyond default PowerPoint templates
- Create impressive presentations using templates
Outlines
Module 1: Introduction
- What is VBA?
- Why need to do programming for MS-Excel.
- What can we do with Excel VBA? (Few interesting examples)
- Using the development Integrated Development E
- The project explorer – Introduction to the VBA project concept and project components
- The property Window.
- The IDE main menu
- Switching between Excel normal interface and IDE interface.
- Help system.
Module 2: Automation via Macros
- Why we need automation in MS-Excel?
- What is macro?
- Recording macros
- How to trigger macros from Excel normal interface?
- How to trigger macros from VBA IDE?
Module 3: Using instructions
- The immediate window
- What is instruction?
- Evaluation instructions
- Command Instructions
- Dealing with Excel VBA objects and their properties
Module 4: Linking VBA with Excel
- Single cell reference methods
- Range reference methods
- Inter-worksheets reference
- Inter-workbook reference
Module 5: The instructions building block
- The Procedure concepts
- Procedures (Subroutines)
- Procedures (Functions)
- Procedures (Event Handlers)
- Pre-mature terminations with Exit keyword
- Grouping instructions using With statement
Module 6: Modules
- Why is module needed?
- Code Module
- User Form in brief
- Class module in brief
- Worksheet module in brief
- Workbook module in brief
- Procedure’s scoping
- Dealing with ambiguities
Module 7: When you make mistake…
- Type of errors
- Dealing with compilation errors
- Dealing with runtime errors
- Dealing with logical errors
- The debugger and debugging process
Module 8: The variables
- Why are variables needed?
- Basic Data Types
- Variable declaration and shorthand
- Variable scoping and life cycle
- Variable initialization
- Option Explicit directive
Module 9: Useful VBA native functions
- MsgBox function
- InputBox function
- Number functions
- String functions
- Date/Time functions
- Format function
- RGB function
Module 10: Other useful basic VBA entities
- Comments
- VBA Constants
- Excel Constants
- Defining constants
- Selection keyword
- Application object
- ActiveSheet object
- Sheet’s collection
- Workbook’s collection
Module 11: The Parameter
- What is parameter?
- Optional parameters and techniques to handle default values.
- Arbitrary argument support using ParamArray
- Parameter passing mechanisms: ByVal ByRef
- Named arguments.
Module 12: Operators
- What is operator?
- Arithmetic operators
- Comparison Operators
- Logical Operators
- Special Operators
Module 13: Branching Constructs
- Unconditional Branching with GoTo statement
- Unconditional Branching with GoSub statement
- If..Then..Else Statement
- Select Case Statement
Module 14: Iteration Constructs
- Unconditional Loop with GoTo statement
- Using For Loop
- Using For Each statement
- Pre-test looping
- Post-Test looping
- Pre-mature termination using Exit keyword