Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Textbox number formatting

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formatting a textbox Ed Excel Discussion (Misc queries) 1 February 24th 08 09:15 PM
Textbox date formatting capt Excel Discussion (Misc queries) 14 January 2nd 08 10:02 AM
Textbox Formatting jmc8355 Excel Discussion (Misc queries) 3 April 24th 07 06:30 PM
textbox formatting jnf40 Excel Discussion (Misc queries) 1 August 3rd 06 08:12 PM
TextBox Formatting grahammal Excel Discussion (Misc queries) 3 April 12th 06 04:54 PM


All times are GMT +1. The time now is 04:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"