Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey Tom,
Thanks for the answer and the lesson. It always helps to understand how the answer works. -Minitman On Sat, 23 Oct 2004 10:20:07 -0400, "Tom Ogilvy" wrote: You don't need to double-double quote the $ sign s# = 1234.56 ? Format(s, """$""#,##0.00") $1,234.56 ? format(s,"$ #,##0.00") $ 1,234.56 I added a space in the second, but that makes no difference: (just for clarity) ? format(s,"$#,##0.00") $1,234.56 so for the OP Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) Textbox1.Text = format(cdbl(Textbox1.Text),"$ #,##0.00") End Sub or (cdbl is optional - excel will coerce the string) Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) Textbox1.Text = format(Textbox1.Text,"$ #,##0.00") End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Userform textbox number formats | Excel Discussion (Misc queries) | |||
userform textbox | Excel Worksheet Functions | |||
Textbox in userform | Excel Programming | |||
Formatting number in a UserForm TextBox | Excel Programming | |||
UserForm TextBox to ActiveSheet TextBox over 256 characters | Excel Programming |