Hi ,
You mean "convert a base26 number to a decimal number".
paste this VB code to your code stage. Input argument is "ColAlpha"(Text) and output argument is "ColNum"(Number).
Add "Microsoft.VisualBasic" and "System.IO" to "Namespace Imports".
Dim AryColAlpha As Char() = ColAlpha.ToCharArray()
Dim LenColAlpha As Integer = ColAlpha.Length - 1
For Each c As Char In AryColAlpha
Dim Currentc As Integer = Asc(c) - 64
If Currentc < 1 Or Currentc > 26 Then ColNum = 0
ColNum += Currentc * CType(Math.Pow(26, LenColAlpha), Integer)
LenColAlpha -= 1
Next
For example, input is "AAA", output is 703. input is "F", output is 6.
Only uppercase alphabets can be allowed as input argument. Please check input argument in advance.
------------------------------
Mitsuko
Asia/Tokyo
------------------------------
Original Message:
Sent: 04-17-2020 08:04
From: Devi Pratyusha Nallagonda
Subject: Get Column Number in Excel
How to get a column number given a cell reference in Excel?
Ex: Cell Reference - F10
Then Column number should be 6 as F is 6th Column.
------------------------------
Devi Pratyusha Nallagonda
------------------------------