选择Excel范围 IronXL allows us to easily select and work with ranges in any Excel WorkSheet. The code below demonstrates how ranges, rows, and columns can be easily selected. With IronXL, it is possible to apply further sorting or calculations to this collection of data using methods such as SortAscending(), SortDescending(), Sum(), Max(), Min(), and Avg(). However, be mindful that when applying methods that modify or move the value of a cell, the affected range, row, and column will also update their values accordingly. Range To select a range from A2 to A8, use var range = sheet["A2:A8"]. Row To select row 1, use the method GetRow(0). The indexing follows zero-based numbering. The range of cells will be determined by the union of the populated cells of all the rows, including row 1 itself. Column To select column A, use the method GetColumn(0) or assign the range address as sheet["A:A"]. The range of cells will be determined by the union of the populated cells of all columns, including column A itself. How to select Excel Range in C# Install C# library to select Excel range Load an existing or generate a new Excel workbook Select the targeted worksheet from the workbook Use sheet["A2:A8"] to select a range from A2 to A8 Use GetColumn and GetRow methods to select individual columns and rows Explore How to Select Excel Ranges with C# and IronXL. 相关文档链接 在Github上查看 相关教程 相关操作指南 类文档 下载IronXL DLL 报告此页面的问题 准备开始了吗? Nuget 下载 1,686,155 | 版本: 2025.11 刚刚发布 免费 NuGet 下载 总下载量:1,686,155 查看许可证