{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Problem Session 9 - Visual Basic for Applications

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

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

View Full Document Right Arrow Icon
MS&E 352 Decision Analysis II Problem Session 9
Image of page 1

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

View Full Document Right Arrow Icon
On our agenda for today… Visual Basic for Applications
Image of page 2
Buttons and Macros Lets create a simple button
Image of page 3

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

View Full Document Right Arrow Icon
Debugging MsgBox Debug.print (Immediate Window – Ctrl+G)
Image of page 4
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
Image of page 5

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

View Full Document Right Arrow Icon
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
Image of page 6
Iteration Logic Do While Do While condition blah blah Loop Do blah blah Loop While condition
Image of page 7

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

View Full Document Right Arrow Icon
Iteration Logic Do Until Do Until condition blah blah Loop Do blah blah Loop Until condition
Image of page 8
Conditional Logic Simple Conditionals If condition_holds Then Do_something
Image of page 9

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

View Full Document Right Arrow Icon
Conditional Logic Nested Conditionals If condition_holds Then Do_something ElseIf another_condition_holds Then Do_something_else End If
Image of page 10
Conditional Logic More Nesting
Image of page 11

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

View Full Document Right Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern