|
The VBA code for the SAT #3 example is also similar to the prior example.
One exception is that we now add lines 8 - 15 to make sure the data output does
not exceed the limitations of the spreadsheet. We have set the maximum to
50,000 to accommodate older versions of Excel (2003 and prior) which allow a
maximum of 65,536 worksheet rows.
In this example, lines 22 and 23 could easily be combined into a single
statement, but we have divided it here into two lines so it will fit on the web
page.
The chief difference between this and the prior example is in lines 26 - 27,
where the array variable stores the value of each iteration rather than the
summary tally of how many iterations fall into each range for the histogram
table.

Finally, in line 37, the data table is
output to the worksheet.
|