Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format of a TextBox in a userform
Good day,
I have a userform that has a TextBox. In this TextBox, I want to enter dollar amounts so that it looks like this: 1 234 567 $. Right now I get this: 1234567. regards, MD |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format of a TextBox in a userform
In the TextBox_Change event add following code
TextBox1.Text = Replace(Format(TextBox1.Text, "#,##0 \$"), ",", " ")\ Sharad "MD" wrote in message ... Good day, I have a userform that has a TextBox. In this TextBox, I want to enter dollar amounts so that it looks like this: 1 234 567 $. Right now I get this: 1234567. regards, MD |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format of a TextBox in a userform
Try,
Textbox1.Text = Format(the_amount,"# ### ##0$") -- HTH RP (remove nothere from the email address if mailing direct) "MD" wrote in message ... Good day, I have a userform that has a TextBox. In this TextBox, I want to enter dollar amounts so that it looks like this: 1 234 567 $. Right now I get this: 1234567. regards, MD |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format of a TextBox in a userform
Thx Bob, onw more Q. I actually have 3 textboxes, when I run the code it
only does it on 1... I have the code setup like so... Private Sub UserForm_Initialize() volet_1.TextBox11.Value = Format(Sheets("data").Range("a11").Value, "# ### ##0 $") volet_1.TextBox12.Value = Format(Sheets("data").Range("A12").Value, "# ### ##0 $") volet_1.TextBox13.Value = Format(Sheets("data").Range("a13").Value, "# ### ##0 $") End Sub "Bob Phillips" a écrit dans le message de news: ... Try, Textbox1.Text = Format(the_amount,"# ### ##0$") -- HTH RP (remove nothere from the email address if mailing direct) "MD" wrote in message ... Good day, I have a userform that has a TextBox. In this TextBox, I want to enter dollar amounts so that it looks like this: 1 234 567 $. Right now I get this: 1234567. regards, MD |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format of a TextBox in a userform
I am surprised. I just created a form and tried it, and it worked fine. I
assume the form is named volet_1, and that the wrap-around we see in the NG is not in your code. BTW, could I suggest that you use Sharad's solution, it is better than mine (:-)). -- HTH RP (remove nothere from the email address if mailing direct) "MD" wrote in message ... Thx Bob, onw more Q. I actually have 3 textboxes, when I run the code it only does it on 1... I have the code setup like so... Private Sub UserForm_Initialize() volet_1.TextBox11.Value = Format(Sheets("data").Range("a11").Value, "# ### ##0 $") volet_1.TextBox12.Value = Format(Sheets("data").Range("A12").Value, "# ### ##0 $") volet_1.TextBox13.Value = Format(Sheets("data").Range("a13").Value, "# ### ##0 $") End Sub "Bob Phillips" a écrit dans le message de news: ... Try, Textbox1.Text = Format(the_amount,"# ### ##0$") -- HTH RP (remove nothere from the email address if mailing direct) "MD" wrote in message ... Good day, I have a userform that has a TextBox. In this TextBox, I want to enter dollar amounts so that it looks like this: 1 234 567 $. Right now I get this: 1234567. regards, MD |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Date Format for Userform TextBox | New Users to Excel | |||
UserForm including TextBox with date (UK format) | Excel Programming | |||
Qn: Date Format in TextBox in UserForm? | Excel Programming | |||
Format of textbox on userform and correct result | Excel Programming | |||
Userform Textbox Currency Format Problems | Excel Programming |