ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   how do i format a textbox on a userform created in excel (https://www.excelbanter.com/new-users-excel/186204-how-do-i-format-textbox-userform-created-excel.html)

Bert

how do i format a textbox on a userform created in excel
 
I created a userform to accept information from the user.
My problem is ,eg i would like the TxtAmount.value to display the amount in
Currency when i enter the number. The same for the percentage control.

I am new to this.

Bernie Deitrick

how do i format a textbox on a userform created in excel
 
Bert,

Text boxes accept text only, so you need to convert the value to the
formatted text that you want.

Something like:

UserForm1.TextBox1.Text = Format(Range("A1").Value, "$#,##0.00")

Same idea for percentages"

UserForm1.TextBox1.Text = Format(Range("A1").Value, "0.00%")

HTH,
Bernie
MS Excel MVP


"Bert" wrote in message
...
I created a userform to accept information from the user.
My problem is ,eg i would like the TxtAmount.value to display the amount
in
Currency when i enter the number. The same for the percentage control.

I am new to this.





All times are GMT +1. The time now is 10:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com