converting numbers to letters

  • Thread starter Thread starter Treebeard
  • Start date Start date
T

Treebeard

I'd like to write a function that converts a integer, to the coressponding
letter in the alphabet?


i.e.

ConvertToLetter(1) ' this would return "A"
ConvertToLetter(2) ' this would return "B"
ConvertToLetter(3) ' this would return "C"
ConvertToLetter(4) ' this would return "D"


Thanks,

Jack
 
There is probably an easier way to do this but this works.

Public Function ConvertToLetter(inputValue)
Select Case inputValue
Case 1
ConvertToLetter = "A"

Case 2
ConvertToLetter = "B"

Case 3
ConvertToLetter = "C"

Case 4
ConvertToLetter = "D"

Case 5
ConvertToLetter = "E"

Case 6
ConvertToLetter = "F"

'.........

Case 26
ConvertToLetter = "Z"

Case Else
ConvertToLetter = "No Letter"



End Select

End Function
 
Back
Top