'---------------------------------------------------------------------------------------
' Procedure : NumAlpha
' Author : Jack
' Created : 6/12/2011
' Purpose : To check that an incoming string (2 chars long) has a format
' RowNum ---- 1 numeric in the range 1-7 and
' Place ---- 1 alpha in the range of A-C
'---------------------------------------------------------------------------------------
' Last Modified:
'
' Inputs: N/A
' Dependency: N/A
'------------------------------------------------------------------------------
'
Sub NumAlpha()
Dim RowNum As String
Dim Place As String
Dim sX As String
On Error GoTo NumAlpha_Error
sX = "9D" '"1C" ' "1P"
RowNum = Left(sX, 1)
If RowNum >= 1 And RowNum <= 7 Then
Debug.Print sX & " is acceptable"
Else
Debug.Print RowNum & " first char is not in valid range 1 -7"
End If
Place = Mid(sX, 2, 1)
If Place = "A" Or Place = "B" Or Place = "C" Then
Debug.Print sX & " part 2 is A thru C"
Else
Debug.Print Place & " is not in A-B-C"
End If
On Error GoTo 0
Exit Sub
NumAlpha_Error:
MsgBox "Error " & Err.number & " (" & Err.Description & ") in procedure NumAlpha of Module AWF_Related"
End Sub