Guarda se così va bene:
Ciao !codice:Private Sub Command1_Click() Dim strProva As String Dim sngSottr As Single Dim str2 As String Dim str3 As String strProva = "Carate Brianza" sngSottr = Len(strProva) ' Prende i primi 4 caratteri: str2 = Mid(strProva, 1, 4) Text1(0).Text = str2 ' Prende i restanti caratteri, con il max di 4 ' compresi i bianchi: str3 = Mid(strProva, 5, (sngSottr - 4)) Text1(1).MaxLength = 4 Text1(1).Text = str3 End Sub

Rispondi quotando