Sub controlla(testo As String)
Dim gg,mm,aa As Long
Dim ris As String
Dim pos As Int
DateTime.DateFormat = "dd/MM/yyyy"
gg = testo.SubString2(0,2)
mm = testo.SubString2(3,5)
aa = testo.SubString2(6,10)
If gg < 1 OR gg > 31 Then
Msgbox2("GIORNO ERRATO","AVVISO","OK","","",Null)
Else If mm <1 OR mm > 12 Then
Msgbox2("MESE ERRATO","AVVISO","OK","","",Null)
Else If aa < 2012 OR aa > 2050 Then
Msgbox2("ANNO ERRATO","AVVISO","OK","","",Null)
Else
ris = gg & "/" & mm & "/" & aa
End If
Return ris
End Sub