montecarlo2012
Well-known Member
- Joined
- Jan 26, 2011
- Messages
- 984
- Office Version
- 2010
- Platform
- Windows
I am trying to code the body metabolic rate by this code but I don't know where I make the mistake, please, somebody give me a hand here.
GENDER | F | BMR | BASAL METABOLIC RATE | |||
WEIGHT | 115 | kilograms | ||||
HEIGHT | 175 | cm | ||||
AGE | 59 | year | ||||
VBA Code:
Option Explicit
Sub bodymetabolic()
Dim gender As String
Dim weight, height, age As Integer
Dim bmr As Long
gender Range("B1")
weight Range("B3").Value
height Range("B5").Value
age Range("B7").Value
Select Case UCase(genger)
Case "F": bmr = 447.593 + (9.247 * Range("B3").Value) + (3.098 * Range("B5").Value) - (5.677 * Range("B7").Value)
Case "M": bmr = 88.362 + (13.397 * Range("B3").Value) + (4.799 * Range("B5").Value) - (5.677 * Range("B7").Value)
End Select
Range("F1") = bmr
End Sub
Last edited by a moderator: