{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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.

MS&E 352 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

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.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern