• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Controlling Program Flow

Useful procedures must be able to make decisions based on the values of variables and then take specified actions based on those decisions. Blocks of code, for example, might need to be repeated until a specified condition occurs. Statements used to make decisions and repeat blocks of code are the fundamental elements that control program flow in VBA and all other programming languages.

All programming languages require methods of executing different algorithms based on the results of one or more comparison operations. You can control the flow of any program in any programming language with just three types of statements: conditional execution (If...Then...End If), repetition (Do While...Loop and related structures), and termination (End... and Exit). Additional flow control statements in VBA and other programming languages make writing code more straightforward.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint