17-04-20 01:05 PM
22-04-20 10:56 AM
04-03-21 09:53 PM
Hi there!! I just saw your response and downloaded your Cell Ref Utilities file. What should I do before download? I got the code, but should I create an Object and code that or introduce that as a code stage in my process?
Thanks a lot,
Rita
05-03-21 02:58 AM
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
------------------------------
05-03-21 04:15 AM