Function GenCode(entry As Variant) As String
' Convert a numeric entry to a code
Dim i As Long
Dim c As String
Dim x As String
Dim str As String
If Len(entry) > 0 Then
For i = 1 To Len(entry)
c = Mid(entry, i, 1)
Select Case c
Case "."
x = "."
Case "0"
x = "J"
Case "1", "2", "3", "4", "5", "6", "7", "8", "9"
x = Chr(64 + Val(c))
End Select
str = str & x
Next i
End If
GenCode = str
End Function
=GenCode(A1)
Function GenCode(ByVal entry As Variant) As String
Dim x As Long
For x = 1 To Len(entry)
If Mid(entry, x, 1) Like "[0-9]" Then Mid(entry, x) = Chr(64 + Mid(entry, x, 1))
Next
GenCode = Replace(entry, "@", "J")
End Function