PDA

View Full Version : textbox value



ashgull80
02-24-2008, 07:53 AM
hi
i have a text box in a userform that displays data after calculating data from cells in a sheet.
but after working out the calculation can i set some perimeters for the text box. so it has a ? sign in front of the value, or rounds a decimal number to 2 decimal places?
thanks ash

Norie
02-24-2008, 07:59 AM
ash

No you can't, a textbox has no such parameters to set.

What you probably want is the Format function.

x = 10

Textbox1.Value = Format(x, "Currency")

ashgull80
03-16-2008, 07:25 AM
what is the x = 10 for?

Bob Phillips
03-16-2008, 07:43 AM
Private Sub TextBox1_AfterUpdate()
With Me.TextBox1

.Value = Format(Replace(Replace(.Value, ",", ""), "?", ""), "?#,##0.00")
End With
End Sub