private static int GetRowNumber(string cellName) { // Create a regular expression to match the column name portion of the cell name. Regex regex = new Regex("[0-9]+"); Match match = regex.Match(cellName); return Convert.ToInt32(match.Value); }