Hello,
I am trying to use Poisson.DIST in VBA code but I keep getting an error saying Object Required
I have attached my sample code that I am trying to get to work, it all works fine when i use poisson.DIST in a worksheet and cells etc, but I am wanting to use it in VBA as I have lots of repartitions to run through.
Is it possible to use Poisson.DIST in VBA?
In the code below I first genetate a row from 0 to 11, then on the second row is the Poisson.DIST using a loop called pdht, the mean is pdmean at 1.55
I am trying to use Poisson.DIST in VBA code but I keep getting an error saying Object Required
I have attached my sample code that I am trying to get to work, it all works fine when i use poisson.DIST in a worksheet and cells etc, but I am wanting to use it in VBA as I have lots of repartitions to run through.
Is it possible to use Poisson.DIST in VBA?
In the code below I first genetate a row from 0 to 11, then on the second row is the Poisson.DIST using a loop called pdht, the mean is pdmean at 1.55
VBA Code:
Sub PopulatePoisson()
Dim col As Integer
Dim pdht As Integer
Dim pdmean As Double
pdmean = 1.55
col = 0
For pdht = 0 To 11
Cells(col + 1, pdht + 1).Value = pdht
Next pdht
col = 0
For pdht = 0 To 11
'Cells(col + 2, pdht + 1).Value = 66
Cells(col + 2, pdht + 1).Value = Poisson.DIST(pdht, pdmean, False) * 100
Next pdht
End Sub