Re: Syntax for converting textbox value to number for performing calculations on it.
Oh working codes as in ones that are already written... I agree except I do not think this means anything to a beginner.
"Val(Replace(txtbox.Value,"%","")) / 100 * Val(txtbox2.Value)" or
".TextBox3.Value = Val(Replace(Replace(.TextBox1.Value, ",", ""), "$", "")) _"
It is like me telling you "Salam alakem, schlonek, Zien hamdala inta schlonek?" or maybe rafriedic, nasilidic or any other arabic phrases.
This is what it looks like to me...
I see value knowing it means the value of a certain cell or textbox (by name) and then ":"::>.;;''/{{}}{?>>">"?}
Here is what I have written so far:
Private Sub Calculate_Mortgage_1_Click()
Me.tbPurchasePrice1.Value = Format$(Val(Sheets("Dashboard").Range("b26").Value), "$#,#.00")
tbAmountFinanced1 = tbPurchasePrice1 - (tbPurchasePrice1 * cbDownPayment1)
tbMortgagePayment1 =
End Sub
Private Sub Calculate_Mortgage_2_Click()
Me.tbPurchasePrice2.Value = Format$(Val(Sheets("Dashboard").Range("B26").Value), "$#,#.00")
tbAmountFinanced2 = tbPurchasePrice2 - (tbPurchasePrice2 * cbDownPayment2)
End Sub
Private Sub Calculate_Mortgage_3_Click()
Me.tbPurchasePrice3.Value = Format$(Val(Sheets("Dashboard").Range("B26").Value), "$#,#.00")
tbAmountFinanced3 = tbPurchasePrice3 - (tbPurchasePrice3 * cbDownPayment3)
End Sub
Private Sub Calculate_Mortgage_4_Click()
Me.tbPurchasePrice4.Value = Format$(Val(Sheets("Dashboard").Range("B26").Value), "$#,#.00")
tbAmountFinanced4 = tbPurchasePrice4 - (tbPurchasePrice4 * cbDownPayment4)
End Sub
Private Sub Calculate_All_Mortgages_Click()
Me.tbPurchasePrice1.Value = Format$(Val(Sheets("Dashboard").Range("B26").Value), "$#,#.00")
Me.tbPurchasePrice2.Value = Format$(Val(Sheets("Dashboard").Range("B26").Value), "$#,#.00")
Me.tbPurchasePrice3.Value = Format$(Val(Sheets("Dashboard").Range("B26").Value), "$#,#.00")
Me.tbPurchasePrice4.Value = Format$(Val(Sheets("Dashboard").Range("B26").Value), "$#,#.00")
tbAmountFinanced1 = tbPurchasePrice1 - (tbPurchasePrice1 * cbDownPayment1)
tbAmountFinanced2 = tbPurchasePrice2 - (tbPurchasePrice2 * cbDownPayment2)
tbAmountFinanced3 = tbPurchasePrice3 - (tbPurchasePrice3 * cbDownPayment3)
tbAmountFinanced4 = tbPurchasePrice4 - (tbPurchasePrice4 * cbDownPayment4)
End Sub
Private Sub Clear_All_Click()
' Clears Purchase Price Text Boxes
tbPurchasePrice1.Text = ""
tbPurchasePrice2.Text = ""
tbPurchasePrice3.Text = ""
tbPurchasePrice4.Text = ""
' Clears Down Payment Combo Boxes
cbDownPayment1.Text = ""
cbDownPayment2.Text = ""
cbDownPayment3.Text = ""
cbDownPayment4.Text = ""
' Clears Amount Financed Text Boxes
tbAmountFinanced1.Text = ""
tbAmountFinanced2.Text = ""
tbAmountFinanced3.Text = ""
tbAmountFinanced4.Text = ""
' Clears Interest Rate Text Boxes
tbInterestRate1.Text = ""
tbInterestRate2.Text = ""
tbInterestRate3.Text = ""
tbInterestRate4.Text = ""
' Clears Term Combo Boxes
cbTerm1.Text = ""
cbTerm2.Text = ""
cbTerm3.Text = ""
cbTerm4.Text = ""
' Clears Mortgage Payment Text Boxes
tbMortgagePayment1.Text = ""
tbMortgagePayment2.Text = ""
tbMortgagePayment3.Text = ""
tbMortgagePayment4.Text = ""
' Clears Net Operating Income Text Boxes
tbNOI1.Text = ""
tbNOI2.Text = ""
tbNOI3.Text = ""
tbNOI4.Text = ""
' Clears Annual Debt Service Text Boxes
tbDebtService1.Text = ""
tbDebtService2.Text = ""
tbDebtService3.Text = ""
tbDebtService4.Text = ""
' Clears Pre Tax Cash Flow Text Boxes
tbPreTaxCashFlow1.Text = ""
tbPreTaxCashFlow2.Text = ""
tbPreTaxCashFlow3.Text = ""
tbPreTaxCashFlow4.Text = ""
End Sub
Private Sub tbAmountFinanced1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
tbAmountFinanced1 = tbPurchasePrice1 - (tbPurchasePrice1 * cbDownPayment1)
End Sub
Display More