Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Format Text Boxes within A User Form

I have 2 text boxes within a user form called "EnterNewConsult" that I need
to format. One text box called "Date of Consult" needs to be formatted in the
00/00/00 date format, and the other called "Quote Amount" needs to be
formatted as $0.00. Can you help me figure out what the code would look like
for those?

Also, how would I go about entering all of the values in my text boxes from
the user form into their corresponding cells within the workbook?

Your help is greatly appreciated!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Format Text Boxes within A User Form

Give this a try:
TextBox1.Text = Format(CDbl(TextBox1.Text), "$#,##0.00")
TextBox1.Value = Format(TextBox1.Value, "dd/mm/yyyy")

Regards,
Ryan---

--
RyGuy


"Jacy Erdelt" wrote:

I have 2 text boxes within a user form called "EnterNewConsult" that I need
to format. One text box called "Date of Consult" needs to be formatted in the
00/00/00 date format, and the other called "Quote Amount" needs to be
formatted as $0.00. Can you help me figure out what the code would look like
for those?

Also, how would I go about entering all of the values in my text boxes from
the user form into their corresponding cells within the workbook?

Your help is greatly appreciated!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Format Text Boxes within A User Form

Oh, just noticed the second pary of your question.

Private Sub CommandButton1_Click()
Sheets("Sheet1").Activate
Cells(1, 1) = TextBox1.Text
Cells(2, 1) = TextBox2.Text

End Sub

Remember, (1,1) is Cell A1, (2,1) is Cell A2, etc.

Regards,
Ryan---


"ryguy7272" wrote:

Give this a try:
TextBox1.Text = Format(CDbl(TextBox1.Text), "$#,##0.00")
TextBox1.Value = Format(TextBox1.Value, "dd/mm/yyyy")

Regards,
Ryan---

--
RyGuy


"Jacy Erdelt" wrote:

I have 2 text boxes within a user form called "EnterNewConsult" that I need
to format. One text box called "Date of Consult" needs to be formatted in the
00/00/00 date format, and the other called "Quote Amount" needs to be
formatted as $0.00. Can you help me figure out what the code would look like
for those?

Also, how would I go about entering all of the values in my text boxes from
the user form into their corresponding cells within the workbook?

Your help is greatly appreciated!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default very close, but not quite

Thank you for your suggestion. It was heading in the right direction, but it
didn't quite give me the result I was hoping for. The box with the date, for
instance, only allows you to input 1 number before it automatically populates
with a date (enter 1, and 30/12/1899 comes up). And with the amount, the
first number entered is always the dollar amount and the second number
entered comes up as the cents (enter 1 & 2, $1.20 comes up). If I leave the
decimal out of the equation then it will allow me to enter all numbers
accurately, except the cents. If you have any thoughts on this, please let me
know. Thank you, again.
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
User Form Text Boxes - Copy format of text boxes NDBC Excel Discussion (Misc queries) 3 July 2nd 09 02:02 AM
how to use text boxes as an array in an EXCEL user form MWJchmsn Excel Programming 2 February 25th 09 05:09 PM
Setting an array of text boxes equal to individual form text boxes lcaretto Excel Programming 6 September 19th 08 04:19 PM
User form and text boxes on charts Joel Mills Excel Programming 2 June 17th 05 10:10 PM
Auto fill text boxes in user form by inputting data in another Finny33 Excel Programming 1 September 13th 04 12:53 PM


All times are GMT +1. The time now is 04:18 AM.

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

About Us

"It's about Microsoft Excel"