Skip to content

Excel get row index and column name from cell referance

private Regex regexRow = new Regex(@”d+”);

public int getRowIndex(string cellReferance) {
  return int.Parse(regexRow.Match(cellName).Value);
}

private Regex regexCol = new Regex(“[A-Za-z]+”);

private string getColumnName(string cellReferance) {
  return regexCol.Match(cellName).Value;
}