© 2007 The Smart Method Ltd
71
Session Four: An
Introduction To VBA
Visual Basic is the most widely used language in the world for building
business applications.
Neil Innes assertion works fine with Visual Basic. It really does only take
two hours to learn all you need to know to write solid, professional code.
We used to teach the entire VBA language in one session but after years
of running our VBA courses in both Excel and Access flavours, decided
that this was too ambitious.
This session will get you started in VBA. The code you’ll write won’t be
professional grade yet but you’ll be well versed in the basics and be able
to write some elementary code. We’ll also introduce the debug tools in
this session. It may seem odd to learn debug tools before you’ve even
understood the language but you’ll find them very useful as you learn
more advanced language elements.
The session that follows this one (“Professional Grade VBA") will build
upon the basic skills learned in this session and add some vital
techniques to make your code professional and robust. This will allow
you to begin to do some really useful things with VBA.
Session Objectives
By the end of this session you will be able to:
Understand subs
Step through code
Understand stepover, step into and step out
Understand variables
Use the immediate window to view and change variable contents
Use the locals window to view and change variable contents
When I was a kid in school, I learned to read and write
And every morning in the hall, we sang with all our might
School days are happy days but then you have to go
And it only takes two hours to put down all you need to know.
Children’s Song by Neil Innes
Session4
4