Formatting number in a UserForm TextBox
The code below is doing what I want in incrementing an
interest rate in a text box by an 1/8 of a point. I would
like it to always display to 3 decimal places, but it goes:
5.125, 5.25, 5.375, 5.5, dropping trailing zeros.
I know it needs a Format. Any help is appreciated.
Private Sub UserForm_Activate()
txtInterestRate.Value = "5.000"
etc.
------------------------------------
Private Sub spnInterestRate_SpinUp()
txtInterestRate.Value = txtInterestRate.Value + 0.125
End Sub
-------------------------------------
Private Sub spnInterestRate_SpinDown()
txtInterestRate.Value = txtInterestRate.Value - 0.125
End Sub
|