By using the character codes to check weather or not the parts of the string is number or letters. Simply make str to whatever is in the box.
This should probably do it.
Sub IllegalEntry()
Dim str As String
Dim Ok As Boolean
Ok = True
str = "The string you want to check"
If Not Left(str, 2) = "BB" Then Ok = False
For t = 3 To 5
If Asc(Mid(str, t)) < 64 Then Ok = False
If Asc(Mid(str, t)) > 91 Then Ok = False
Cells(i, t) = (Mid(str, t))
Next t
For t = 6 To 7
If Asc(Mid(str, t)) < 48 Then Ok = False
If Asc(Mid(str, t)) > 57 Then Ok = False
Next t
If Ok = False Then
' <What you want to happen if it's an illegal entry>
End If
End Sub
Bookmarks