1Function columnNumber(colLetter As String) As Integer
2
3 Dim colNumber As Integer
4 Dim i As Integer
5
6 colLetter = UCase(colLetter)
7 colNumber = 0
8 For i = 1 To Len(colLetter)
9 colNumber = colNumber + (Asc(Mid(colLetter, Len(colLetter) - i + 1, 1)) - 64) * 26 ^ (i - 1)
10 Next
11
12 columnNumber = colNumber
13
14End Function