Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
I have 3 text boxes on a form and a label that show the
sum of the 3. How do I format the text boxes and label so it shows currency. If user enters 123 I want it to display as $ 123.00 in the text box and in the label. Thanks for your help |
#2
![]() |
|||
|
|||
![]()
Is this an Excel question or an ACCESS question?
If Access, select the text boxes in the form's Design View and choose Currency from the Format page of the Properties window. If not Access, please explain what you mean by "text boxes" & "labels" |:) "Doug Loewen" wrote: I have 3 text boxes on a form and a label that show the sum of the 3. How do I format the text boxes and label so it shows currency. If user enters 123 I want it to display as $ 123.00 in the text box and in the label. Thanks for your help |
#3
![]() |
|||
|
|||
![]()
You can have userforms in excel, too!
CyberTaz wrote: Is this an Excel question or an ACCESS question? If Access, select the text boxes in the form's Design View and choose Currency from the Format page of the Properties window. If not Access, please explain what you mean by "text boxes" & "labels" |:) "Doug Loewen" wrote: I have 3 text boxes on a form and a label that show the sum of the 3. How do I format the text boxes and label so it shows currency. If user enters 123 I want it to display as $ 123.00 in the text box and in the label. Thanks for your help -- Dave Peterson |
#4
![]() |
|||
|
|||
![]()
Maybe something like this:
Option Explicit Dim BlkProc As Boolean Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) Dim myStr As String With Me.TextBox1 If IsNumeric(.Value) Then BlkProc = True myStr = Format(.Value, "$ ##0.00") .Value = myStr Me.Label1.Caption = myStr BlkProc = False End If End With End Sub Doug Loewen wrote: I have 3 text boxes on a form and a label that show the sum of the 3. How do I format the text boxes and label so it shows currency. If user enters 123 I want it to display as $ 123.00 in the text box and in the label. Thanks for your help -- Dave Peterson |
#5
![]() |
|||
|
|||
![]()
I set up a boolean variable and never used it!
Option Explicit Dim BlkProc As Boolean Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) Dim myStr As String if blkproc = true then exit sub With Me.TextBox1 If IsNumeric(.Value) Then BlkProc = True myStr = Format(.Value, "$ ##0.00") .Value = myStr Me.Label1.Caption = myStr BlkProc = False End If End With End Sub To stop the code from running itself. <<snipped |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to select multiple text boxes in excel for formatting | New Users to Excel | |||
How can I force certain text formatting in a cell? | Excel Discussion (Misc queries) | |||
Conditional Formatting of Text... | Excel Discussion (Misc queries) | |||
Formatting text.... | Excel Worksheet Functions | |||
Concatenation formula loses text wrap formatting | Excel Discussion (Misc queries) |