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
Conditions in Visual Basic for Applications - IF and SELECT CASE
Part one of a three-part series of blogs
This part of the Excel VBA training series of blogs shows how to use IF / ELSE / END IF within VBA, and also how to use the alternative SELECT / CASE syntax within macros.
At the heart of programming is the ability to test a condition. You can do this in Excel with a simple IF function:
A simple IF function, testing whether Olly the Owl is underpaid or not
In Excel VBA you also write conditions using the word IF, but the syntax is more flexible and is - usually - split over different lines. This blog shows how to use the IF / ELSE / END IF syntax followed by the alternative SELECT CASE syntax.
For all but the simplest conditions the SELECT CASE format will give code which is easier to write, comment and understand.
Let's start, then, with the simple IF condition!
|Parts of this blog|
25 Aytoun Street