IE 212: COMPUTATIONAL METHODS FOR INDUSTRIAL ENGINEERING SUMMER 2015 OUTLINE OF MATERIAL IN LECTURE NOTES #4, #5, AND #6 ***Important note: Make sure you review the midterm exam study guide as well since the final exam includes all lectures from the beginning of the class. LECTURE #4: WORKING WITH VARIABLES AND USER INTERFACES 1. Working with Variables a. Data types in Excel VBA Most common data types in Excel VBA Memory requirements and allowable ranges for most common data types Common criteria to select data types b. Declaring and naming variables Keyword to declare variables Rules on naming variables Declaring constant variables c. Scope of variables Differences between private and public variables Keywords to use to declare private and public variables 2. Working with User Interfaces a. The MsgBox function Purpose Arguments b. The InputBox function Purpose Arguments LECTURE #5: PROGRAMMING STRUCTURES 1. Arithmetic Operators a. Addition (+) b. Subtraction (-) c. Multiplication (*) d. Floating division (/) e. Integer division (\) f. Exponentiation (^) g. Modulus operation (Mod) 2. Comparison Operators a. Less than (<) b. Less than or equal (<=) c. Greater than (>) d. Greater than or equal (>=) e. Not equal (<>) 3. If Statements a. Basic form of the If…Then…Else statement Basic flowcharts for If…Then…Else statements 1 b. Advantages of using the alternative If…ElseiIf…Else statement c. Logical checks and Booleans Logical And Logical Or Using variables of type Boolean in selection structures d. The Select Case statement Basic flowchart for the Select Case statement Alternatives for defining individual cases to compare against the control variable 4. Repetition Structures a. Basic requirements for counter-controlled repetition b. The For…Next loop Basic structure of the For…Next loop Basic flowchart for the For…Next loop c. Do While and Do Until loops Basic structure of the Do loops Basic flowchart for the Do loops 5. Exit Statements a. Exit Sub statement b. Exit Function statement c. Exit For statement d. Exit Do statement e. End statement LECTURE #6: FUNCTION PROCEDURES AND ARRAYS 1. Organizing Sub Procedures 2. Function Procedures a. Differences between Function procedures and Sub procedures b. Critical elements of a Function procedure Name of the function procedure Type of the variable that receives the value returned by the function procedure c. Syntax of a Function procedure d. Writing and interpreting Function procedures 3. Methods for Passing Variables to Function and Sub Procedures a. By reference b. By value ByVal keyword Parentheses 4. Public and Private Procedures 5. Using Arrays in Excel VBA a. Characteristics of arrays b. Benefits of using arrays Differences between an array and a scalar variable c. Declaring arrays One-dimensional vs. two-dimensional array declarations Fixed size Dynamic size 2 d. Array indices Default index of the first element in one-dimensional vs. two-dimensional array Alternative array declaration to change default index Option Base 1 statement e. Accessing elements in an array using their index f. Using the functions LBound and UBound g. Populating arrays using repetition structures 3