Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MD MD is offline
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 212
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
MD MD is offline
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Format for Userform TextBox John Calder New Users to Excel 4 July 29th 09 10:19 PM
UserForm including TextBox with date (UK format) John Elink Excel Programming 2 December 1st 04 10:02 AM
Qn: Date Format in TextBox in UserForm? Michael Vaughan Excel Programming 1 August 23rd 04 10:03 AM
Format of textbox on userform and correct result Mark Excel Programming 1 July 13th 04 02:49 PM
Userform Textbox Currency Format Problems Dunce in SC Excel Programming 2 October 27th 03 01:45 AM


All times are GMT +1. The time now is 06:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"