I have these codes to add and multiply textboxes but I'm not coming up with the correct amount in the total textbox. It ends up being more than what it should so how do I write this to get the correct amount? I have searched and can't find nothing to fit for what I'm looking for. In the attached file on the userform "frmGunParts" that calculates the cost of parts.
Private Sub txtMTLcst_Change()
If txtMTLcst.Value = "" Then txtMTLcst.Value = 0
If txtLBRcst.Value = "" Then txtLBRcst.Value = 0
If txtQTY.Value = "" Then txtQTY.Value = 0
txtTOTALcst.Value = (Val(txtMTLcst.Value) + Val(txtLBRcst.Value)) * Val(txtQTY.Value)
sh.Cells(iRow + 1, 6) = txtMTLcst.Value
txtMTLcst = Format(txtMTLcst.Value, "$###,##")
End Sub
Private Sub txtLBRcst_Change()
If txtMTLcst.Value = "" Then txtMTLcst.Value = 0
If txtLBRcst.Value = "" Then txtLBRcst.Value = 0
If txtQTY.Value = "" Then txtQTY.Value = 0
txtTOTALcst.Value = (Val(txtMTLcst.Value) + Val(txtLBRcst.Value)) * Val(txtQTY.Value)
sh.Cells(iRow + 1, 9) = txtLBRcst.Value
End Sub