# Microsoft Office Application Help - Excel Help forum > Excel Programming / VBA / Macros >  >  vb convert column letter to number

## jtwork

Im looking for a VB way to convert a column letter to a number.

Does anyone have a function that can do this or some code i can adapt?

----------


## royUK

Try this.




```
Please Login or Register  to view this content.
```

----------


## jtwork

This looks like it converts a number to a letter im asfter the other way around letter to number

----------


## mudraker

With VBA code you usually do not need to convert column letters to numbers as there is usually a way to utilize letters or numbers within your commands
commands like cell(rownumber,columnnumber or columnletter)

Why do you need to convert column letters to numbers


This is some code I used years ago that converts letters to numbers & a 2nd macro that converts numbers to letters. I used this when I was just starting out coding in Excel VBA in the early days of Excel 5 and have not used it since

They are constructed as functions to be called from another macro




```
Please Login or Register  to view this content.
```





```
Please Login or Register  to view this content.
```


' Convert Column Number to Letter (from Col A to ZZ)
' ****************************************************************






```
Please Login or Register  to view this content.
```

----------


## wiggles

Hi,
 I needed to do the same. My solution follows (legend: s = string with a letter or two which denote the column, a = integer representing 1st letter, b = integer representing the second letter):




```
Please Login or Register  to view this content.
```


Hope it helps.  :Wink:  
w.

----------


## Khan Ego

If anyone else looking for a solution to this problem: I believe there are easier, most likely more efficient ways to do both things:

To convert the column letter to the column number you could use:




```
Please Login or Register  to view this content.
```



To convert the column number to the column letter you could use:




```
Please Login or Register  to view this content.
```



As an Excel workbook always needs to contain at least one visible worksheet, these two functions will always work correctly and very efficient.

Best regards,
Philip

----------


## romperstomper

> As an Excel workbook always needs to contain at least one visible worksheet, these two functions will always work correctly and very efficient.



That's not strictly true. A workbook needs to have one visible _sheet_, but it doesn't have to be a _work_sheet.

----------


## Marcol

And another way



```
Please Login or Register  to view this content.
```



Hope this helps

----------


## hhiippyy

one ot he fastes way ro do it 




```
Please Login or Register  to view this content.
```

----------


## protonLeah

This is an old thread and should be locked and archived.

----------


## url

Or maybe put into an FAQ section.

I found it helpful.

----------


## dustinkamdar

A simple way to go either way:

Number to letter:




```
Please Login or Register  to view this content.
```


Letter to number:




```
Please Login or Register  to view this content.
```

----------

