User Forms - Formating fields

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

Guest

I have a really easy question on a user form.

I have some fields on a form that I want to have the field reformat the
number entered into 2 decimals and to use commas (ie 1000 should re-format to
1,000.00) when the user exits the field.

What is the easiest way to do this?

Thanks!
 
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1.Text = Trim$(Format$(Val(TextBox1.Text), "#,##0.00"))
End Sub

HTH. Best wishes Harald
 

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