I think the question sums it up. Given two integers for row and column or four integers for row and column for the two corners of a range, how do I get a range object for that range.
Press F5 or CTRL+G to launch the Go To dialog. In the Go to list, click the name of the cell or range that you want to select, or type the cell reference in the Reference box, then press OK. For example, in the Reference box, type B3 to select that cell, or type B1:B3 to select a range of cells.
Excel. Range that contains a single cell, an entire column, an entire row, or it can be a string that names a single cell in the language of the application.
Package: excel. Range represents a set of one or more contiguous cells such as a cell, a row, a column, or a block of cells.
Where the range is multiple cells:
Excel.Worksheet sheet = workbook.ActiveSheet; Excel.Range rng = (Excel.Range) sheet.get_Range(sheet.Cells[1, 1], sheet.Cells[3,3]);
Where range is one cell:
Excel.Worksheet sheet = workbook.ActiveSheet; Excel.Range rng = (Excel.Range) sheet.Cells[1, 1];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With