Convert number to letters in Excel

Solved/Closed
milindvc Posts 12 Registration date Wednesday September 12, 2012 Status Member Last seen September 13, 2012 - Sep 12, 2012 at 02:36 AM
hachiya Posts 1 Registration date Friday May 27, 2016 Status Member Last seen May 27, 2016 - May 27, 2016 at 11:11 AM
Hello,

I have to define the numbers to their associated letters and based on the combination of numbers the next cell should show the letters.

Example:

1 = A
2 = B
3 = C
4 = D....

If I enter number in A1 cell as 3214, in B1 cell I should get CBAD i.e. [C(3), B(2), A(1), D(4)]

Can we do this with simple formula. I am not aware of VB and Macros. Please provide your suggestions

10 responses

fairooz Posts 11 Registration date Thursday May 27, 2010 Status Member Last seen September 12, 2012 12
Sep 12, 2012 at 05:25 AM
If only upto the 9th Alphabet is needed then you can do the following:

Press Alt + F11, VB Window will appear
From the menu above Click "Insert" then "Module" then paste the below code:
---------------------------------------------------------------
Sub convertToAlphabets()

Dim rng, TargetRange As Range
Dim itemCount, cellLength As Long
Dim TempStr As String

itemCount = Range("A1").CurrentRegion.Rows.Count
Set rng = Range("A:A")
Set TargetRange = Range("B:B")

For j = 2 To itemCount
TempStr = ""
cellLength = Len(rng.Cells(j, 1))
For I = 1 To cellLength
Select Case Mid(rng.Cells(j, 1), i, 1)
Case 1: TempStr = TempStr + "A"
Case 2: TempStr = TempStr + "B"
Case 3: TempStr = TempStr + "C"
Case 4: TempStr = TempStr + "D"
Case 5: TempStr = TempStr + "E"
Case 6: TempStr = TempStr + "F"
Case 7: TempStr = TempStr + "G"
Case 8: TempStr = TempStr + "H"
Case 9: TempStr = TempStr + "I"
End Select
Next i
TargetRange.Cells(j, 1) = TempStr
Next j
End Sub
---------------------------------------------------------------
Then press "F5"

Note: Save your document first before running the code. It will replace all the cells in Column B and you can not undo this operation. Let me know if it worked
6