• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Convert Letter to number

I have a spreadsheet with one coumn contaoing drawing revision. This can be either number or letters.
I want to create a new column where the revision letter is changed to a number. A=1, B=2 ...
Where the revision is a number I want the new coumn to leave the cell empty.
Anyone who can help?
 
I have added a copy of some of the lines in my workbook.
I want Excel to return the number of the letter in the alphabeth from column E into column J and leave empty if E is a number.
 

Attachments

  • Bok1.xlsx
    11 KB · Views: 6
Copy next Module1 and
use in sheet like cell A2 write =ColLetterToNum(A1)

Code:
Function ColLetterToNum(ByVal sColLetter As String) As Long
    Application.ScreenUpdating = False
    ColLetterToNum = ActiveWorkbook.Worksheets(1).Columns(sColLetter).Column
    Application.ScreenUpdating = True
End Function
and You could get all columns letters (not only until Z) show like numbers
 
Last edited:
Back
Top