Search
 
SCRIPT & CODE EXAMPLE
 

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;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# get total milliseconds from datetime 
Csharp :: c# array.join 
Csharp :: integer required asp.net core 
Csharp :: How to catch Entity Framework Errors C# 
Csharp :: how to restart flutter app programmatically 
Csharp :: how to get total scenes unity 
Csharp :: generate certificate in windows 
Csharp :: C# return and set multiple values from method 
Csharp :: transform.position.x unity 
Csharp :: unity how to destroy child 
Csharp :: asp.net mvc get current url in view 
Csharp :: IHttpContextAccessor 
Csharp :: c# remove all whitespaces from string 
Csharp :: c# linq select as new object 
Csharp :: c# array max 
Csharp :: c# binary search 
Csharp :: how to filter a datatable in c# 
Csharp :: LINQ query on a DataTable C# 
Csharp :: maclaurin series 
Csharp :: Write text in Word Document at specific location using C# 
Csharp :: string tochararray c# 
Csharp :: combobox selected item c# 
Csharp :: unity render to texture2d 
Csharp :: group by unique c# 
Csharp :: carousel asp.net mvc beginner 
Csharp :: element click intercepted exception in selenium C# 
Csharp :: why is called c# 
Csharp :: unity set parent canvas 
Csharp :: c# singleton 
Csharp :: enum in c# 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =