Possible duplicate:
How to convert a column number (e.g. 127) to an excel column (e.g. AA)
Ok, so I am writing a method that takes a 2d array as a parameter. I want to place this 2d array on an Excel worksheet, but I need to define the final cell. I can get the height easy enough:
var height = data.GetLength(1);
It gives me an axis Y, but it's not easy for me to get an axis X. Obviously, I can get this number:
var width = data.GetLength(0);
This gives me the number I want to convert to a letter. So, for example, 0 is A, 1 is B, and so on, until we get to 26, which returns to A. I am sure there is an easy way to do this, but I have a complete mental block.
What would you do?
thank