Combinar rangos de Excel
IronXL nos permite combinar más de un IronXL.Ranges.Range
usando el operador '+'.
using IronXL; using System; using System.Linq; WorkBook workBook = WorkBook.Load("sample.xls"); WorkSheet workSheet = workBook.WorkSheets.First(); // Get a range from an Excel worksheet var range = workSheet["A2:A8"]; // Combine two ranges var combinedRange = range + workSheet["A9:A10"]; // Iterate over combined range foreach (var cell in combinedRange) { Console.WriteLine(cell.Value); }
Imports IronXL Imports System Imports System.Linq Private workBook As WorkBook = WorkBook.Load("sample.xls") Private workSheet As WorkSheet = workBook.WorkSheets.First() ' Get a range from an Excel worksheet Private range = workSheet("A2:A8") ' Combine two ranges Private combinedRange = range + workSheet("A9:A10") ' Iterate over combined range For Each cell In combinedRange Console.WriteLine(cell.Value) Next cell
Install-Package IronXL.Excel
IronXL nos permite combinar más de un IronXL.Ranges.Range
usando el operador '+'.
9 productos API .NET para sus documentos de oficina