View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Cesar Zapata[_2_] Cesar Zapata[_2_] is offline
external usenet poster
 
Posts: 66
Default Textbox number formatting

Mike,

you need this


Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)

TextBox1.Text = Format(TextBox1.Text, "$##,##0.00")

End Sub

once you click the tab the text box will be formmatted



"Mike" wrote in message
...
Hello all,

I'm working on a VB UI in Excel and I'm wondering if
there is some VB code that I can use on exit of textbox
fields to change the user-entered numbers into currency
format (for example: the user enters 1000000 and tabbing
out of the field the number is replaced with
$1,000,000.00). I can't seem to remember any of the code
to convert the numbers...

Thanks in advance and have a great day,

Mike