Currency Format on UserForm when opened!

G

Guest

The values of a text box on a UserForm appear as numbers. I want to diplay
the value of these text boxes in currency format when the form is opened.
How do I write the code to ensure currency format is always displayed?
 
D

Dave Peterson

You can use something like:

Option Explicit
Private Sub UserForm_Initialize()
Me.TextBox1.Value = Format(1234.23, "$#,##0.00")
End Sub
 
G

Guest

help...still unable to get the UserForm (DisbSchForm) to display currency
when opened (Show).
i have thirty txt boxes named txtbox01, txtbox02, txtbox03...txtbox30 &
& when i type in what you told me it displays only a number? i do not want
the decimal places to display & the currency amount can be up to 9 digits.
--
Thanks,
Robo


Dave Peterson said:
You can use something like:

Option Explicit
Private Sub UserForm_Initialize()
Me.TextBox1.Value = Format(1234.23, "$#,##0.00")
End Sub
 
D

Dave Peterson

Something like this?

Me.TextBox1.Value = Format(1234.23, "$#,##0")

help...still unable to get the UserForm (DisbSchForm) to display currency
when opened (Show).
i have thirty txt boxes named txtbox01, txtbox02, txtbox03...txtbox30 &
& when i type in what you told me it displays only a number? i do not want
the decimal places to display & the currency amount can be up to 9 digits.
 

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