Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# get excel column number from letter

public static int ColumnNameToIndex(string name)
{
  var upperCaseName = name.ToUpper();
  var number = 0;
  var pow = 1;
  for (var i = upperCaseName.Length - 1; i >= 0; i--)
  {
    number += (upperCaseName[i] - 'A' + 1) * pow;
    pow *= 26;
  }

  return number;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #excel #column #number #letter
ADD COMMENT
Topic
Name
3+7 =