PDA

View Full Version : Solved: Format numbers



ioncila
12-29-2009, 06:01 PM
Hi
I need a little help for a little issue:

In a textbox or combobox
if I write 1, it would appear 0,01
if I write 12, it would appear 0,12
if I write 12345, it would appear 123,45
if I write 1234500, it woulf appear 12.345,00
etc.

Is that simple?

Thanks

mikerickson
12-29-2009, 07:36 PM
Perhaps something like
Private Sub TextBox1_AfterUpdate()
With TextBox1
If IsNumeric(.Text) And InStr(.Text, ".") = 0 Then
.Text = Format(Val(.Text) / 100, "#,##0.00")
End If
End With
End Sub

ioncila
12-30-2009, 05:45 AM
Thank You Very Much
Its solved