Good morning.
After having read the answer on a question about optimizing Excel Interop, I found that referencing a cell using worksheet.Range["A1:C3"] (same as worksheet.get_range("A1:C3")) isn’t very handy. I’d like to reference the cell somehow using integer/long numbers, and I wouldn’t want to map column numbers {1, 2, 3, …} to column letters {“A”, “B”, “C”, …}.
Note: I know about .Cells, but this isn’t an option as this only returns single cells AFAIK.
Any idea?
regards
You can use the Cells property to create a Range object that can be used as argument to the Range property.
Check out the example here: http://msdn.microsoft.com/en-us/library/bb178282.aspx In the middle of the page you have an example where you use the Cells property to get two range objects that you pass to the Range property instead of passing strings:
In general, the Cells property returns a Range object that you can do whatever you want with: http://msdn.microsoft.com/en-us/library/bb148836.aspx