Avevo modificato l'eventoTextBox1_Change in questo modo:
Private Sub TextBox1_Change()
If Len(TextBox1) = 10 Then
s_Data$ = Format$(TextBox1, "00/00/0000")
If IsDate(s_Data$) = False Then
MsgBox "La data immessa non é esatta!"
Else
TextBox1 = vbNullString
Cells(1, 1).Value = s_Data$
End If
'End If
'X = Len(TextBox1)
'y = LTrim(TextBox1.Text)
'If X = 2 Then TextBox1 = y & "/"
'If X = 5 Then TextBox1 = y & "/"
'If X = 10 Then
[A1] = CDate(TextBox1) 'si copia il testo come data (CDate) in una cella
TextBox2.SetFocus
End If
End Sub
|