ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Number Format Controls on a User Form (https://www.excelbanter.com/excel-programming/354228-number-format-controls-user-form.html)

ChelseaWarren

Number Format Controls on a User Form
 
I have a user form with text boxes that request dollar values. How can I
format the text box as currency when the user enters an amount?

Thanks in advance for any help.

Tom Ogilvy

Number Format Controls on a User Form
 
Private Sub TextBox1_Exit(ByVal Cancel As _
MSForms.ReturnBoolean)
if isnumeric(Textbox1.Value) then
Textbox1.Value = Format(cdbl(Textbox1.value),"$ #,##0.00")
End If
End Sub

--
Regards,
Tom Ogilvy

"ChelseaWarren" wrote in message
...
I have a user form with text boxes that request dollar values. How can I
format the text box as currency when the user enters an amount?

Thanks in advance for any help.




ChelseaWarren

Number Format Controls on a User Form
 
Tom -

Thanks a million!!

"Tom Ogilvy" wrote:

Private Sub TextBox1_Exit(ByVal Cancel As _
MSForms.ReturnBoolean)
if isnumeric(Textbox1.Value) then
Textbox1.Value = Format(cdbl(Textbox1.value),"$ #,##0.00")
End If
End Sub

--
Regards,
Tom Ogilvy

"ChelseaWarren" wrote in message
...
I have a user form with text boxes that request dollar values. How can I
format the text box as currency when the user enters an amount?

Thanks in advance for any help.






All times are GMT +1. The time now is 05:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com