Formatting Userforms fields

M

Marc

I'm new to the whole VBA world and I been having a hard time to figure out if
we can format fields as part of VBAa Userform.

Example:

I have a currency field that I would like to show in the userform as
$1,500.00.
 
H

Helmut Weber

Hi Marc,

like this:

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1.Text = Format(TextBox1.Text, "$ #,###.00")
End Sub

The actual result of the format function regarding
comma and period (fullstop) depends on localization.

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 

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

Top