559 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Free VBA training tutorial |
---|
As well as running introductory and advanced VBA training courses in the UK for small groups, we've also published this online training course teaching how to code macros using Visual Basic for Applications (VBA) within Excel. The tutorial covers everything from basic recording through to creating classes - something for everyone! |
Wise Owl provide classroom-based training in VBA and other Microsoft software in the UK. However, we've also published this free tutorial on how to write Visual Basic for Applications macros within Excel.
Note that we also run VBA, Excel and SQL courses, either in London and Manchester in the UK or at your offices.
A good place to start when learning VBA for Excel is to learn how to record macros, and then start writing basic code yourself:
Tutorial | Learn how to ... |
---|---|
Record macros in Excel (and also various techniques for playing them back and for modifying the code generated by Excel). | |
Start writing VBA code within Excel to automate your workbooks | |
The art and science of writing comments for your VBA code. |
You can't do much in Excel VBA without knowing how to move around a worksheet!
Tutorial | Learn how to ... |
---|---|
Go to a cell or range in Excel. | |
Select cells and ranges relative to your starting position. |
The next thing to learn is how to display input and message boxes (as part of this module you'll also learn about variables):
Tutorial | Learn how to ... |
---|---|
Use variables and constants in your code | |
Use the MsgBox command to display pop-up messages. | |
Use the InputBox function to get data from your user. |
The next thing to understand is how VBA is written, using objects, collections, properties and methods:
Tutorial | What it's about |
---|---|
VBA is what's called an object-orientated programming language - learn what this means! |
Any programming language allows you to test conditions and do things iteratively (in loops), and Visual Basic for Applications is no different:
Tutorial | Learn how to ... |
---|---|
Use IF statements and SELECT ... CASE to test conditions. | |
Learn the four main types of loop built into VBA. |
In Excel VBA you can attach code to events which happen for a workbook or worksheet (such as running code whenever you open a particular file):
Tutorial | Learn how to ... |
---|---|
Attach code to events for Excel workbooks and worksheets. | |
Create event sinks to capture application-level events (such as a user creating a new workbook). |
Sometimes your programs will have bugs in (!) - these tutorials show how to minimise the chances of these occurring, and track them down when they do:
Tutorial | Learn how to ... |
---|---|
Stepping through code, setting breakpoints, using the call stack and other options for debugging macros. | |
Using the Err object to display errors, and trapping for errors using ON ERROR and RESUME. |
You can link to other applications such as Word or PowerPoint from within Excel,:
Tutorial | Learn how to ... |
---|---|
Write code using references to manipulate documents in Word, presentations in PowerPoint, etc. | |
An alternative way to create and use references (of interest mostly just for techies!). | |
How to write code to create references programmatically (not for the faint-hearted). |
You can use FileDialogs to choose files to open or save, TextStream objects to read and write files and create a FileSystemObject to copy, move or delete files:
Tutorial | Learn how to ... |
---|---|
Use FileDialogs to make it easier for users to choose files. | |
Read from a file line-by-line (or write to one) using a TextStream. | |
Create a reference to the Microsoft Scripting Runtime object library to get access to all of the files on your hard disk! |
How to use ActiveX Data Objects (ADO) to link to SQL Server or Access databases from within Excel (or do it the other way round, and link from Access to Excel, say):
Tutorial | Learn how to ... |
---|---|
List records, add records or edit or delete records in a table in Access, SQL Server, etc. |
When you're familiar with basic programming, it's time to learn advanced concepts, such as passing arguments and using recursion:
Tutorial | Learn how to ... |
---|---|
Pass arguments to subroutines (using ByRef and ByVal) and understand optional arguments and ParamArray. | |
What recursive programming is, and how to use it to list files or to list out hierarchical data structures. |
In addition to the built-in Excel functions, you can write your own, and you can also incorporate functions within your code to make it easier to write and read:
Tutorial | Learn how to ... |
---|---|
Write your own functions, and then call them from within your code or incorporate them into Excel. | |
Create add-ins to share code that you've written between different workbooks. |
Variables aren't the only way to hold data in VBA programs!
Tutorial | Learn how to ... |
---|---|
Learn how to create static and dynamic arrays, and how to use multi-dimensional arrays. | |
Learn how to write strongly-typed code with enumerations (and indeed what strongly-typed coding means!). |
You can have great fun drawing shapes on worksheets in VBA, or annotating charts using symbols:
Tutorial | Learn how to ... |
---|---|
Learn how to draw shapes onto charts and worksheets, including smiley faces! |
Create your own dialog boxes, by drawing user forms on screen and integrating them with your macros:
Tutorial | Learn how to ... |
---|---|
Use the toolbox and properties window to draw user forms on screen. | |
Integrate macros and user forms (including validating data entered using code). | |
Learn how to create advanced controls such as combo boxes, list boxes, option buttons, MultiPages and SpinButtons. |
Classes within Excel VBA are your own customised objects, to which you breathe life by writing methods and properties:
Tutorial | What it covers |
---|---|
An explanation of what classes are, and how to create and use class modules in VBA. | |
Creating your own collections within Visual Basic (both typed and untyped). |
One final thought - Wise Owl also run classroom-based Excel and VBA training courses in the UK (and overseas, if you're willing to pay expenses!).
Some other pages relevant to the above blog include:
From: | Bestofphx |
When: | 14 Aug 20 at 17:37 |
Do these still work on the latest edition of excel?
Chris
From: | Andrew G |
When: | 15 Aug 20 at 06:55 |
Hi, yes they do, VBA hasn't really changed much since the videos were recorded. We do have a more up-to-date range of Excel VBA videos using more recent versions of Excel if you prefer https://www.wiseowl.co.uk/online-training/excel-vba/
I hope that helps!
From: | Bestofphx |
When: | 16 Aug 20 at 00:56 |
Thank you. I'll bookmark both these pages. Definitely will help with my job. :)
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2023. All Rights Reserved.