You can get to a cell by index using [x,y], which would just require a
translation of the name to indexes, which I happen to already have
internally and I'm pasting my code below. There's no current way to
access cells based off of a named range. I've pondered it, but there
was actually a lot more to named regions than I had expected, relative
positions vs absolute, etc, and I couldn't decide on how the interface
would work on it.
private static Point CalculatePoint(string cellName)
{
Point cell = new Point();
int colLength = 0;
int colCount = 0;
char currentLetter = cellName[colLength++];
while (currentLetter > '9')
{
colCount = colCount * 26 + (currentLetter - 'A' + 1);
currentLetter = cellName[colLength++];
}
cell.X = colCount - 1;
cell.Y = Int32.Parse(cellName.Substring(colLength - 1)) - 1;
return cell;
}
private class Point
{
public int X;
public int Y;
}
Bruce Dunwiddie