Problem Session 9 - Visual Basic for Applications

# Problem Session 9 - Visual Basic for Applications - MS&E...

This preview shows pages 1–12. Sign up to view the full content.

Decision Analysis II Problem Session 9

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
On our agenda for today… Visual Basic for Applications
Buttons and Macros Lets create a simple button

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Debugging MsgBox Debug.print (Immediate Window – Ctrl+G)
Iteration Logic While Loops Dim MyArray(5) As Double For I = 1 To 5 MyArray(I) = Rnd Next I For Each n In MyArray Debug.Print n Next n Array Indexing Starts from 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Iteration Logic While-Wend Loops Dim MyArray(5) As Double I = 0 While i<5 MyArray(I) = Rnd I = I+1 Wend For Each n In MyArray Debug.Print n Next n
Iteration Logic Do While Do While condition blah blah Loop Do blah blah Loop While condition

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Iteration Logic Do Until Do Until condition blah blah Loop Do blah blah Loop Until condition
Conditional Logic Simple Conditionals If condition_holds Then Do_something

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Conditional Logic Nested Conditionals If condition_holds Then Do_something ElseIf another_condition_holds Then Do_something_else End If
Conditional Logic More Nesting If condition_holds Then Do_something

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 06/16/2010 for the course MS&E 352 taught by Professor Ronhoward during the Winter '09 term at Stanford.

### Page1 / 21

Problem Session 9 - Visual Basic for Applications - MS&E...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online