0% found this document useful (0 votes)
61 views1 page

Bmi (Body Mass Index)

The document provides instructions to create a macro named BMI that calculates body mass index (BMI) scores. The macro will: 1) Obtain height in feet and inches from cells A2 and B2 and store as variables. 2) Calculate total height in inches and store as a variable. 3) Use an input box to obtain weight and store as a variable. 4) Calculate BMI score using the formula and output result to cell D2. 5) Include a run button on Sheet2 to execute the macro.

Uploaded by

Cristiam Velez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views1 page

Bmi (Body Mass Index)

The document provides instructions to create a macro named BMI that calculates body mass index (BMI) scores. The macro will: 1) Obtain height in feet and inches from cells A2 and B2 and store as variables. 2) Calculate total height in inches and store as a variable. 3) Use an input box to obtain weight and store as a variable. 4) Calculate BMI score using the formula and output result to cell D2. 5) Include a run button on Sheet2 to execute the macro.

Uploaded by

Cristiam Velez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Problem 2

Concepts Create macro, obtain data from worksheets, output data to worksheets, InputBox
Difficulty level Easy-Medium
Complete this problem on Sheet2.
The Body Mass Index (BMI) score is used by doctors as a very rough measure of a persons health and can be
calculated using the following formula:

BMI = 703

weight
(height) 2

Weight has units of pounds and height is in inches. For example, if you weigh 150 lbs and are 5' 5", which is 65 inches,
your BMI score would be,
150
703 2 = 24.96
65
You will create a macro named BMI that calculates a persons BMI score. For the height, input the number of feet in
cell A2 and the number of inches in cell B2. For example, if a person is 6' 2", type 6 into A2 and 2 into B2. The BMI
macro will accomplish the following tasks:
Obtain the values for feet and inches from cells A2 and B2, and store the values in variables
Calculate the persons total height in inches and store this value in a variable (hint: there are 12 inches in a foot)
Obtain the persons weight using an input box and store this value in a variable
Calculate the persons BMI score and output this value to cell D2
Create a run button on Sheet2 that executes the macro BMI. Be sure to input the values of feet and inches into cells
A2 and B2 before clicking the run button.
If you would like to learn more about the BMI metric, you can visit the following website:
http://en.wikipedia.org/wiki/Body_mass_index

You might also like