Number Format Controls on a User Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
Tom -

Thanks a million!!

Tom Ogilvy said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top