  Anthony Sun Excel VBA Examples  Statistics and Math   Simulation Basic Tutorial 101       Excel VBA Examples

This section contains introductory and intermediate Excel VBA examples.  Generally, the examples are smaller in scope.  Also in this section, Simulation Basic Tutorial 101, a section that provides tutorial on basic VBA skills needed before creating a simulation with Excel VBA and an Excel VBA Basic Tutorial series (3 parts) for Beginners.
This is an essential skill for creating a simulation. Topics in this section cover declare an array, resize an array, manage dynamic array, create multi-dimensional array, and find the array size.
Provides examples on all the loop structures: For...Next with Step, Do...While...Loop, So Until...Loop, and etc.
This tutorial shows how to call a sort sub procedure, passes the array to it, and returns a sorted array.
Contains tutorial using If...Else, If...ElseIf, and Select Case statements.
This example shows how to derive unique random values by sorting one array based on another array.
A tutorial on how to create a histogram by passing array into the histogram sub procedure and returns the frequency distribution from the array. Simulation Basic Tutorial 102
One of the most essential 'Must Know' in simulation. Two of the mostly used statistic estimates in action. Second tier statistic estimates. Compute the simulated values at a specific percentile. Compute the probability at a specific value (or profit).  Excel VBA Basic Tutorial Series Provides step by step example on creating and recording a macro, modules and procedures, scope, calling sub procedure and function, passing argument by value and by reference.
Introductory on workbook, worksheet, range, cells. Method and Property.
Array creation and management, decision structures, and loop structures.
Compute the median from an array.
Generate uniform random number within a range.
Sum up number in a array using loop.
Compute factorial using sum and loop
Compute binomial coefficient
Compute the probabilty from a standard normal distribution.
Extract the maximum and the minimum values in an array using sorting method.   