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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Harvey

Well-known Member
Joined
Nov 18, 2004
Messages
953
Have it link to another cell (lets say B1). Then in your cell use the formula VAL(B1)
 

Chitosunday

Well-known Member
Joined
Jul 14, 2003
Messages
1,023
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
 

Harvey

Well-known Member
Joined
Nov 18, 2004
Messages
953
remind that if you put the $ into the text box, the cell on your sheet will have an extra $
 

Forum statistics

Threads
1,181,994
Messages
5,933,137
Members
436,881
Latest member
CMScons

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
Top