Private Sub TextBox1_Change()
Dim sep$, pos%
With TextBox1
If .Text = "" Then Exit Sub
sep = Application.DecimalSeparator
.Text= Replace(.Text, ".", sep)
If Not IsNumeric(Left(.Text, 1)) Then .Text = "" Else If Not IsNumeric(Right(.Text, 1)) And Right(.Text, 1) <> sep Then .Text = Left(.Text, Len(.Text) - 1)
pos = InStr(.Text, sep)
If pos = 0 Then .Text = Format(.Text, "#,##0") Else If Len(Mid(.Text, pos + 1)) > 1 Then .Text = Format(Left(.Text, pos + 2), "#,##0.00")
End With
End Sub