public static int ColToInt(string columnRef)
{
if (string.IsNullOrEmpty(columnRef))
{
throw new ArgumentNullException("columnRef");
}
if (!Regex.IsMatch(columnRef, @"^[A-Z]+$"))
{
throw new FormatException("Column reference not valid");
}
return ColToIntRec(columnRef);
}