The way it's written, it should return "F0". An alternative approach would be something like this. With this method, it wouldn't matter where the value fell in the string or even if the values weren't in order.
<%
Dim strABC, strP, strF, intI, intJ, intK, intL
strP=Request.Form("NValue")
strF=Trim(strP)
If strF > "" Then
NumberToABC(strF)
End If
Response.Write "<form action=""n2a.asp"" method=""post"">" & vbNewLine & _
" <table align=""center"" width=""300px;"" bgColor=""white"" border=""0"" style=""border-collapse:collapse;"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"" bgColor=""lightblue"">" & vbNewLine & _
" <table align=""center"" width=""100%"" bgColor=""black"" border=""1"" style=""border-collapse:collapse;"" cellpadding=""4"" cellspacing=""1"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" colspan=""2"" bgColor=""lightblue"">" & vbNewLine & _
" <font face=""arial"" size=""6"" color=""navy""><b>Number to String</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" width=""50%"" bgColor=""#D7954B"">" & vbNewLine & _
" <font face=""arial"" size=""4"" color=""#4F0F00"">Numeric Value: " & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""left"" width=""50%"" bgColor=""#FFFFFF"">" & vbNewLine & _
" <input type=""text"" name=""NValue"" value=""" & Request.Form("NValue") & """ size=""20"" maxlength=""10"">" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
If strABC > "" Then
Response.Write " <tr valign=""middle"">" & vbNewLine & _
" <td align=""right"" width=""50%"" bgColor=""#D7954B"">" & vbNewLine & _
" <font face=""arial"" size=""4"" color=""#4F0F00"">Alpha Value: " & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""left"" width=""50%"" bgColor=""#FFFFFF"">" & strABC & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
End If
Response.Write " </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"">" & vbNewLine & _
" <input type=""submit"" value=""Submit"">" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"</form>" & vbNewLine
Response.End
Function NumberToABC(strF)
If strF = "" or IsNull(strF) Then
Exit Function
Else
txtABCWords = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"
txtEquivalentReplace = "1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100,200,300,400,500,600,700,800"
If Instr(txtEquivalentReplace,strF) Then
intJ = 0: intK = 0
For intI = 1 to len(txtEquivalentReplace)
If mid(txtEquivalentReplace,intI,1) = "," Then
intJ=intJ+1
If mid(txtEquivalentReplace,intI+1,len(strF))=strF Then
intK=intJ
intL=(intK*2)+1
strABC = mid(txtABCWords,intL,1)
Exit For
End If
End If
Next
Else
Response.Write "Number not found."
End If
End If
End Function
%>