Search for question
Question

Solve the following problems using Excel/VBA. Use a different module in the VBE for each problem.

1. Body mass index (BMI) is a measure of obesity. In standard units, it is calculated by the formula:

W

BMI = 703-

where W is weight in pounds and H is height in inches.

a. Create a VBA sub named BodyMassIndex that will ask the user for their weight and height

in separate input boxes then display the BMI in a message box. Place a button on your

spreadsheet that will run the sub. Your TA will test this to make sure it is working.

b. Adapt your solution to part A to be a user defined function "BMI(W,H)" with arguments for

weight (W) and height (H). Show an example of your function's use in a random cell on your

spreadsheet.

Fig: 1