Hello All,
I am trying to format the text in an userform. Rather than merely displaying the value in the textbox as a plain number, I want to apply formatting. For example, percent or currency.
For example, on my userform, the user can enter a value for "Other Income". I am able to format the textbox after the user enters a value using this code for the textbox ...
But when the userform is first opened, the textbox displays the value in plain text. I have tried to insert this code into the UserForm_Activate event, but to no avail ...
Can anyone help with the method to format the same textbox when the userform is first opened?
Thanks,
Steve
I am trying to format the text in an userform. Rather than merely displaying the value in the textbox as a plain number, I want to apply formatting. For example, percent or currency.
For example, on my userform, the user can enter a value for "Other Income". I am able to format the textbox after the user enters a value using this code for the textbox ...
VBA Code:
Private Sub otherincome_textbox_exit(ByVal Cancel As MSForms.ReturnBoolean)
otherincome_textbox.Text = Format(otherincome_textbox.Text, "$#,###0")
End Sub
But when the userform is first opened, the textbox displays the value in plain text. I have tried to insert this code into the UserForm_Activate event, but to no avail ...
VBA Code:
Private Sub UserForm_Activate()
dim statements
otherincome_textbox.Text = Format(otherincome_textbox.Text, "$#,###0")
....
more stuff
End sub
Can anyone help with the method to format the same textbox when the userform is first opened?
Thanks,
Steve