I have a Calculator that multiples a number by a bunch of percentages that are entered into different text boxes below those results are displayed into text boxes across from the percentage. Something is either wrong with my formula or I need to change the textboxes to allow for percentages (with four decimal places) to be accepted.
When calulating I used 100 * 25% and the result was 2500 (should have been 25), then I used 100 * .25 and it worked correctly.
Here is my code:
Private Sub cmdCalculate_Click()
txtRM1e = Val(txtBlnd) * Val(txtRM1)
txtRM2e = Val(txtBlnd) * Val(txtRM2)
txtRM3e = Val(txtBlnd) * Val(txtRM3)
txtRM4e = Val(txtBlnd) * Val(txtRM4)
txtRM5e = Val(txtBlnd) * Val(txtRM5)
txtRM6e = Val(txtBlnd) * Val(txtRM6)
txtTtlRM = Val(txtRM1e) + Val(txtRM2e) + Val(txtRM3e) + Val(txtRM4e) + Val(txtRM5e) + Val(txtRM6e)
txtTtlPer = Val(txtRM1) + Val(txtRM2) + Val(txtRM3) + Val(txtRM4) + Val(txtRM5) + Val(txtRM6)
End Sub
When calulating I used 100 * 25% and the result was 2500 (should have been 25), then I used 100 * .25 and it worked correctly.
Here is my code:
Private Sub cmdCalculate_Click()
txtRM1e = Val(txtBlnd) * Val(txtRM1)
txtRM2e = Val(txtBlnd) * Val(txtRM2)
txtRM3e = Val(txtBlnd) * Val(txtRM3)
txtRM4e = Val(txtBlnd) * Val(txtRM4)
txtRM5e = Val(txtBlnd) * Val(txtRM5)
txtRM6e = Val(txtBlnd) * Val(txtRM6)
txtTtlRM = Val(txtRM1e) + Val(txtRM2e) + Val(txtRM3e) + Val(txtRM4e) + Val(txtRM5e) + Val(txtRM6e)
txtTtlPer = Val(txtRM1) + Val(txtRM2) + Val(txtRM3) + Val(txtRM4) + Val(txtRM5) + Val(txtRM6)
End Sub