Now we'll demonstrate how to model normally distributed data using VBA code,
applying the hybrid VBA - worksheet approach to the same problem we just solved
with the worksheet-only approach.
This is the first of two VBA approaches we'll demonstrate. The current
example will use a VBA array to summarize the data, reporting back to the
worksheet only the summary histogram data table used for generating our chart.
In the next example that follows, we'll move a step closer towards the minimal
VBA approach by writing the raw data to the worksheet, and using the worksheet
functionality to generate the histogram data table in the same way we did in the
As seen below, the input screen for the VBA approach is virtually identical to
that of the worksheet-only approach, with the exception that we've added cells
for # of iterations and screen refresh interval.
This example illustrates the value of the screen refresh technique. By
visually observing the histogram, we can easily estimate how many iterations are
necessary for consistent results.
Our Outputs region here too is similar to that of the worksheet only approach,
with the obvious exception that it doesn't include the raw data table.
This version also contains the "Iterations Processed" progress indicator.
Now let's look under the hood at the VBA code.