It is not that easy.
This works (for integers), but I do not like programs that automatically change the user's input, it can be annoyoing. Let me know if this is ok for you
Marco
Option Explicit
Private Sub Text1_Change()
On Error GoTo errsub
Dim d As Long
d = Text1.Text
Dim c As Long
c = Text1.SelStart
Dim s As String
s = FormatNumber(d, 0, , , vbTrue)
Text1.Text = s
If Len(s) > Text1.Text Then
Text1.SelStart = c
Else
Text1.SelStart = c + 1
End If
errsub:
End Sub
|