power4XL Microsoft Excel Resource Center
Free Macros, Formulas, Functions, Tutorials, Downloads, Add-Ins & More!

VBA source code for modeling normal distributions of SAT scores - example #3

ShareThis

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.

 

Prev | Contents | Next

Copyright notice:  This site and all content, including computer code and spreadsheet examples, are copyright 2006 by Fritz Dooley.  License is granted for individual users to download examples and to copy code directly into user's spreadsheets and Visual Basic for Applications files.  Users may not redistribute code in any way.  Providing hyperlinks to this web site is encouraged, but posting code and examples on other web sites is expressly forbidden.  "Microsoft" is a registered trademark of Microsoft Corporation.   Neither this web site nor Fritz Dooley is affiliated with Microsoft Corporation.