Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
551 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers 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 ...
In this page
We've split our introductory VBA training courses into a two-day Excel macros course and a two-day advanced VBA course (the latter also applies to Word, PowerPoint and other MS Office applications). We also offer a three-day fast-track VBA course.
This page gives an idea of what you'll learn on our VBA courses, but you can see far more at our main VBA training courses page.
Our two-day introduction to VBA in Excel course will show you how to create basic macros, including selecting cells and declaring variables. Here's an example:
Sub RecordVote()
'the name of each superhero
Dim HeroName As String
'the rating assigned to them
Dim HeroRating As Long
'go to the votes sheet and get the value of the superhero, and their rating
Worksheets("Votes").Select
HeroName = Range("C4").Value
HeroRating = Range("C6").Value
'go to top of results
Worksheets("Results").Select
Range("B4").Select
'go to first blank cell
ActiveCell.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
'write variable values into this blank row
ActiveCell.Value = HeroName
ActiveCell.Offset(0, 1).Value = HeroRating
'copy formats from cell above (included here just to make macro complete)
Range(ActiveCell.Offset(-1, 0), ActiveCell.Offset(-1, 1)).Copy
ActiveCell.PasteSpecial xlPasteFormats
Application.CutCopyMode = False
End Sub
However, by day two you'll be writing some fairly ambitious macros, including looping over collections:
Sub CloseAllButCodeWorkbooks()
'a reference to each workbook in turn
Dim wb As Workbook
'for each of the open workbooks ...
For Each wb In Workbooks
'if it isn't this one containing the code (note that you can't directly compare two workbooks: instead, you must see if they have the same name)
If wb.Name <> ThisWorkbook.Name Then
'it's not the same - close it down, giving user a chance to save changes (this is the default)
wb.Close
End If
'now go on automatically to the next workbook
Next wb
End Sub
Our two-day advanced VBA course is aimed at people who already know Visual Basic for applications, and want to learn about referencing other applications, using file dialog boxes, creating classes, passing arguments by reference or value, recursive programming and the like. To give you a taste, here's the sort of macro you'll learn from the advanced VBA course:
Sub RequestLetter()
'try consuming your class!
Dim Guess As New clsLetterGuess
'keep guessing until letter guessed or too many goes
Guess.StartGuess
'display what was guessed
If Len(Guess.LetterGuessed) = 0 Then
MsgBox "No letter guessed"
Else
MsgBox "You guessed " & Guess.LetterGuessed
End If
'now get rid of the object (the garbage collector will
'do this anyway, so this line is not strictly
'necessary)
Set Guess = Nothing
End Sub
If you don't think this looks that complicated, bear in mind that clsLetterGuess is an object which we've created!
This fast-track VBA course combines:
All of the topics from the two-day Introduction to Excel VBA course; and
Most of the topics from the two-day Advanced VBA course (the big omission is class modules, which notwithstanding the above we don't actually think are that useful in VBA).
The course is aimed at people who have a very good aptitude for VBA.
If your ambitions lie beyond MS Office, you might like to consider our other programming courses:
See our VBA page for more details on all things to do with Visual Basic for Applications training.
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 2024. All Rights Reserved.