Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

How can I write a vba code that uses Compound Poisson disrtibution to estimates

ID: 3573617 • Letter: H

Question

How can I write a vba code that uses Compound Poisson disrtibution to estimates the number of claims when I input the number of policyholders. The model should have a user form and some buttons in excel. The user form should be available in excell. The code should estimate those who are killed, seriously injured and slightly injured with probabilities of 0.0009, 0.001141 and 0.0080195 respectively. So on the user form there should be somewhere to enter number of polyholders, a button to calculate this so I can get the estimate after a simulation. So when I click the buton I should have an estimate of those who are going to get killed, severely injured and slightly injured. And there shoul be another button to clear that infomation.

Explanation / Answer

Solution :

Step1 : open th VB editor.
step2: click insert-> userform.
step3: Add the labels, text boxes and command buttons
Step4 : Code for command box
Private Sub CommandButton1_Click()
UserForm1.Show
End Sub
Step5 : The line sets the focus on the first text box
Private Sub UserForm_Initialize()
TextBox1.SetFocus
End Sub
Step6 : the first part of the Userform is created and it wont effect when the value is entered in the ID text box

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote