how to show dollar sign in a textbox on a userform?

monometh

New Member
Joined
Jul 18, 2004
Messages
29
I've looked around and am still unsure of the definitive way to show $ signs on a textbox which is suppose to be in currency.

my textbox references cell which is on spreadsheet formatted to dollars..

obviously this isn't carrying through, what vb code must it be to make this vaclue in currency format?
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Have it link to another cell (lets say B1). Then in your cell use the formula VAL(B1)
 
Upvote 0
assuming the name of your textbox is textbox1 then your code should be:

Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If TextBox1.Text = "" Then TextBox1.Text = "$"
End Sub
 
Upvote 0
remind that if you put the $ into the text box, the cell on your sheet will have an extra $
 
Upvote 0

Forum statistics

Threads
1,215,309
Messages
6,124,180
Members
449,146
Latest member
el_gazar

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