Face to face / Online public schedule & onsite training. Restaurant lunch included at STL venues.
| (265 reviews, see all 107,247 testimonials) |
From £300 List price £350
This course is suitable for advanced users of Microsoft Excel looking to further increase their knowledge of VBA.
A good working knowledge of the topics covered in the Microsoft Excel VBA Introduction course is required, or completion of our Excel VBA Introduction course.
Storing information with variables
How and why you should declare variables
Determining which data type to use
Public v Private scope
Using variables to trap errors
Using the Locals window to observe variables
Creating functions
Writing your own User Defined Functions (UDFs)
Working with multiple arguments
Using your function in Excel
Message Boxes and Input Boxes
Displaying a message
Adding a yes / no user choice
Getting feedback from the end user
Handling Errors
Defining VBA's Error Trapping Options
Capturing Errors with the On Error Statement
Determining the Err Object
Coding an Error-Handling Routine
Using Inline Error Handling
Creating custom dialogue boxes with UserForms
Drawing UserForms
Setting UserForm properties, events and methods
Using text boxes, command buttons, combo boxes and other controls
Formatting controls
Applying code to controls
How to launch a form in code
Arguably, the most experienced and highest motivated trainers.
Training is held in our modern, comfortable, air-conditioned suites.
Modern-spec IT, fully networked with internet access
A hot lunch is provided at local restaurants near our venues:
Courses start at 9:30am.
Please aim to be with us for 9:15am.
Browse the sample menus and view joining information (how to get to our venues).
Available throughout the day:
Regular breaks throughout the day.
Contains unit objectives, exercises and space to write notes
Available online. 100+ pages with step-by-step instructions
Your questions answered on our support forum.
|
|
Hewlett-Packard Ltd
Sanj Sanghera,
Management Consultant
Enjoyed the course and learning the importance of Variables. Great enthusiasm demonstrated by Marius and I will practice the methods he has has taught.
Excel VBA Intermediate
B G Group
Derek Budd,
Business Analyst
Marius was excellent, really enthusiastic and helpful.
Learnt A LOT today, highly recommend this course.
Thank you!
Excel VBA Intermediate
University of Greenwich
Mig Farinas,
Lecturer
Well done yet again!
Excel VBA Intermediate
| Next date | Location | Price |
|---|---|---|
| Tue 30 Jun | Limehouse | £325 |
| Mon 27 Jul | Online | £290 |
| Tue 4 Aug | Bloomsbury | £290 |
| Thu 10 Sep | Online | £290 |
| Fri 11 Sep | Limehouse | £290 |
| Fri 16 Oct | Online | £290 |
And 16 more dates...
Loading content...

Excellent
HSBC
Project Manager
Alexander Orlov
"I was looking for a specific training for my data analytical team to equip them with more tools to slice and dice the data, building more trust worthy sophisticated propensity models, using SQL, VBA and Excel. I came across with STL training and my research and expectations were match by 100%. Spot on! Great professionals! Highly recommended for all banking and financial professionals that are using Excel on BAU basis."
Tutorials and discussions on MS Office
MS Office tips to save you time
MS Office shortcut keys for all versions
Handy info on industry trends
Latest news & offers
Loading content...
Below are some extracts from our Excel training manuals.
Variables are used to store data that your VBA code can manipulate. Think of them as containers that hold information
which can be referenced and manipulated throughout your code.
Why declare variables?
Improves Code Readability: Declaring variables makes your code easier
to read and understand.
Error Checking: VBA can catch errors related to undeclared variables.
Memory Management: Helps manage memory usage efficiently.
How to declare variables?
Use the Dim statement:
Dim variableName As DataType
Example:
Dim total As Integer
Dim name As String
Choosing the right data type is crucial for efficient memory usage and performance. Here are some common data types:
Integer: Whole numbers.
Long: Larger whole numbers.
Double: Numbers with decimals.
String: Text.
Boolean: True or False.
Example:
Dim age As Integer
Dim salary As Double
Dim isActive As Boolean
Creating your own functions in Excel VBA can greatly enhance your productivity by allowing you to perform custom
calculations and operations. Let’s go through the process of creating User Defined Functions (UDFs) with multiple examples.
A UDF is a custom function that you can create using VBA. These functions can be used in Excel just like built-in functions.
To create a UDF, you need to define a function using the Function keyword, followed by the function name, any arguments,
and the data type of the return value.
Function FunctionName(arguments) As DataType
' Function code
FunctionName = result
End Function
Example 1: Simple Addition Function
Function AddNumbers(x As Double, y As Double) As Double
AddNumbers = x + y
End Function
You can use this function in Excel by typing =AddNumbers(5, 10) in a cell, which will return 15.
The Err object contains information about the error that occurred. Key properties include:
Err.Number: The error number.
Err.Description: A description of the error.
Err.Source: The name of the object or application that caused the error.
Example:
Sub ExampleErrObject()
On Error Resume Next
Dim x As Integer
x = 1 / 0
If Err.Number <> 0 Then
MsgBox 'Error ' & Err.Number & ': ' & Err.Description
Err.Clear ' Clear the error
End If
End Sub
Creating custom dialogue boxes with UserForms in Excel VBA can greatly enhance the interactivity of your spreadsheets.
Let’s go through each step with examples:
1. Drawing UserForms
To create a UserForm:
Open the Visual Basic for Applications (VBA) editor by pressing Alt + F11.
Insert a new UserForm by selecting Insert > UserForm.
2. Setting UserForm Properties, Events, and Methods
You can set properties such as the form’s name, caption, and size in the Properties window. For example:
Name: MyUserForm
Caption: Custom Dialog
To handle events like initializing the form, you can use the code window:
Private Sub UserForm_Initialize()
Me.Caption = 'Welcome to My Custom Dialog'
End Sub
3. Using Text Boxes, Command Buttons, Combo Boxes, and Other Controls
You can add controls by selecting them from the Toolbox and drawing them
on the UserForm.
For example:
TextBox: For user input.
CommandButton: To trigger actions.
ComboBox: For dropdown selections.
Call for assistance
We will call you back