'Generate a Gamma distributed random variable with parameters a and B Public Function Gamma(ByVal a As Double, ByVal B As Double) As Double Gamma = WorksheetFunction.GammaInv(alea(), a, B) End Function