Combiner plusieurs plages Excel en C#
IronXL nous permet de combiner plus d'un IronXL.Ranges.Range en utilisant l'opérateur '+'.
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 cellInstall-Package IronXL.Excel
IronXL nous permet de combiner plus d'un IronXL.Ranges.Range en utilisant l'opérateur '+'.