i would simply append the "$" in front of the value before putting it in the text box. Than if you want to do math with it (having the $1.50 for instance) you can than use the CCur() command
textbox1.text="$"&textbox1.text
value = CCur(textbox1.text)
I assume you are talking about a textbox on a Userform?
If yes, you can code some lines in the OnExit event of the textbox:
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If IsNumeric(TextBox1) Then 'be sure a number is filled out
TextBox1 = Format(TextBox1, "$#,##0.00"
Else
MsgBox "Please enter a number" 'some message
End If
End Sub
Be aware that the regional settings of your computer influence the output.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.