From the course: Excel VBA: Process Modeling
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Adapt the code for multiple runs
From the course: Excel VBA: Process Modeling
Adapt the code for multiple runs
- In the previous movie you ran a simulation that calculated the time a costumer would spend at each station of a sandwich shop. The code we created only allowed for a single run which doesn't provide much helpful information. In this movie I will show you how to add a loop to your simulation code that let's you run multiple simulations so you get more data to analyze. My sample file is Chapter02_08. That's an Excel workbook you can find in the Chapter02 folder of your exercise files collection. We need to make some changes to our workbook, adding information to the sim setup worksheet, and also code within the VBA module. So I'll start in the worksheet. We need to define the number of runs. In other words, the number of times that the simulation will be repeated. So I'll click in cell D2, and type "# of Runs". And I'll the hashtag or number symbol for number. Then I'll click cell A2. Click on the format painter, and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Define process flow and programming goals55s
-
Declare variables used in the simulation6m
-
(Locked)
Define the Customers class and add a customer4m 48s
-
(Locked)
Define the Stations class and add a station8m 56s
-
(Locked)
Add code to calculate and write out times6m 2s
-
(Locked)
Delete unneeded objects1m 50s
-
(Locked)
Run the simulation1m 55s
-
(Locked)
Adapt the code for multiple runs4m 8s
-
(Locked)
-
-
-
-
-
-