Hi @Mansour_Dalir ,
You can do this by circulating the modulo 26 or multiplying it by 26.
Try the following code.
Function NumberToString(number As Integer) As String
Dim result As String = ""
While number > 0
Dim remainder As Integer = (number - 1) Mod 26
result = Convert.ToChar(remainder + Asc("A")) & result
number = (number - remainder) \ 26
End While
Return result
End Function
Function StringToNumber(str As String) As Integer
Dim result As Integer = 0
For Each c As Char In str
result *= 26
result += Asc(c) - Asc("A") + 1
Next
Return result
End Function
Best Regards.
Jiachen Li
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.