Skip to main content

Posts

Showing posts with the label word conversion

Convert Number To Letter in excel micro

If you want to convert any number to letter then you can use this micro. Its easy to implement just you create new micro and paste this code then in any cell you can call that function. Function ConvertToLetter(iCol As Integer) As String ' Dim iAlpha As Integer ' Dim iRemainder As Integer ' iAlpha = Int(iCol / 27) ' iRemainder = iCol - (iAlpha * 26) ' If iAlpha > 0 Then ' ConvertToLetter = Chr(iAlpha + 64) ' End If ' If iRemainder > 0 Then ' ConvertToLetter = ConvertToLetter & Chr(iRemainder + 64) ' End If Dim columnName As String Dim modulo As Integer While iCol > 0 modulo = (iCol - 1) Mod 26 columnName = Chr(65 + modulo) + columnName iCol = Int((iCol - modulo) / 26) Wend ConvertToLetter = columnName End Function