OK, first attempt no good, but this is a better one, all code in the
Userform:
Option Explicit
Private strTemp As String
Private btPos As Byte
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
strTemp = TextBox1
btPos = TextBox1.SelStart
End Sub
Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
If IsValid(TextBox1) = False Then
TextBox1 = strTemp
TextBox1.SelStart = btPos
End If
End Sub
Function IsValid(strText As String) As Boolean
Dim i As Byte
If Len(strText) > 11 Then
Exit Function
End If
For i = 1 To Len(strText)
Select Case i
Case 1, 2, 3, 5, 6, 7
If Len(strText) > 1 Then
If IsAlpha(Mid$(strText, i, 1)) = False Then
Exit Function
End If
Else
If IsAlpha(strText) = False Then
Exit Function
End If
End If
Case 4, 8
If Asc(Mid$(strText, i, 1)) <> 47 Then
Exit Function
End If
Case 9, 10, 11
If IsNumeric(Mid$(strText, i, 1)) = False Then
Exit Function
End If
Case Else
Exit Function
End Select
Next
IsValid = True
End Function
Function IsAlpha(strText As String) As Boolean
If Asc(strText) > 64 And _
Asc(strText) < 123 Then
IsAlpha = True
End If
End Function
Function IsNumeric(strText As String) As Boolean
If Asc(strText) > 47 And _
Asc(strText) < 59 Then
IsNumeric = True
End If
End Function
RBS