Hi,
I need to convert excel column letter to index value. suppose column letter is AA, index value should be 27.
Hi,
I need to convert excel column letter to index value. suppose column letter is AA, index value should be 27.
Some code here will help.
Hi @reshmaprabh
Check this code
colName = "AA" result = colName.Select(Function(c, i) ((Convert.ToInt32(c) - Convert.ToInt32("A"c) + 1) * (CInt(Math.Pow(26, colName.Length - i - 1))) )).Sum()
Refer this also.! @reshmaprabh
Thanks!
I got the solution. Thanks everyone…
columnLetter = columnLetter.ToUpper()
sum=0
For i As Integer = 0 To columnLetter.Length-1
sum *= 26
Dim charA As Double = Asc(“A”)
Dim charColLetter As Double = Asc(columnLetter(i))
sum += (charColLetter - charA) + 1
Next
You could also use this snippet from the marketplace:
https://go.uipath.com/component/convert-numbers-to-excel-column-name
Or take a look into this solution from @Palaniyappan
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.