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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,214,551
Messages
6,120,159
Members
448,948
Latest member
spamiki

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