Poisson.DIST in VBA

STGlove

New Member
Joined
Feb 20, 2024
Messages
3
Office Version
  1. 2021
Platform
  1. Windows
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

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
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
What gets highlighted when the error occurs and you click Debug? I suspect Poisson.DIst is in the Analysis Toolpak (VBA) add-in, have you loaded that? IN addition, you probably have to reference that add-in, in the VBA Editor menu Tools, References.
 
Upvote 0

Forum statistics

Threads
1,215,098
Messages
6,123,082
Members
449,094
Latest member
mystic19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top