I need TextBox to display $ values

Big Lar

Well-known Member
Joined
May 19, 2002
Messages
557
Code:
[FONT=Verdana]Private Sub TextBox21_Change()<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>[/FONT]
[FONT=Verdana]TextBox31.Value = "$" & (Val(TextBox21.Value) * 0.25<o:p></o:p>[/FONT]
[FONT=Verdana]End Sub<o:p></o:p>[/FONT]
<o:p></o:p>
<o:p></o:p>
If TB21.Value value is 2<o:p></o:p>
TB31 displays $0.5<o:p></o:p>
<o:p></o:p>
What code change will display 2 places after the decimal point?<o:p></o:p>
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Not sure what you're trying to do, but see if this code helps:
Code:
Sub AsboCows()
MsgBox Format(2000000000, "$#,##.00")
End Sub
 
Upvote 0
Hello, it could look like something like the following:

Code:
Private Sub CommandButton1_Click()
Me.Hide
Unload Me
End Sub
 
Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
With TextBox1
    Let .Value = Format$(.Value, "Currency")
End With
End Sub
 
Upvote 0
JackDanIce...
You lost me with that code. Where does it go in my project? And, does it effect every TextBox?



The UserForm will be used as a cash report...where users enter coin counts.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
TextBox21 is the total number of coins entered by the user<o:p></o:p>
TextBox31 displays the actual value of the coins<o:p></o:p>
<o:p></o:p>
So, if the user enters 2 into TB21
TB31 should display $0.50 instead of $0.5
...and the code is for this TextBox only.<o:p></o:p>
 
Upvote 0

Forum statistics

Threads
1,224,514
Messages
6,179,219
Members
452,895
Latest member
BILLING GUY

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top