May 1999
Intermediate to advanced
1440 pages
38h 6m
English
Many VBA macros run in a simple fashion. Starting with the Sub statement, they execute every statement in the macro, from start to finish. This is fine as long as you want the macro to do the same thing every time, but sometimes you need a macro that's a little smarter than that. VBA provides a wide variety of program control structures that enable you to change the way the statements are executed, depending upon conditions that are found while the macro is running.
Perhaps the simplest and most commonly used control structure in VBA is the If…Then…End If statement. This statement enables you to execute a group of VBA statements only if some condition is true. Consider an example ...
Read now
Unlock full access