Creates a Range of cells from an array of Areas. A Range is a collection of Area s; an Area area is a rectangular collection of cells.

 public Range CreateNamedRange(Area[] rangeAreas, System.String rangeName)
Public Function CreateNamedRange(ByVal rangeAreas As Area(), ByVal rangeName As String) As Range

Array or Areas representing the range.

The name to assign to the range.

A Range object representing the range of cells created.

Note that if a range named rangeName already exists in the workbook, it will be overwritten with the new named range created by this method.


          Range rng = wb.CreateNamedRange(
               new Area[]{
               worksheet1.CreateArea(2, 4, 2, 5),
               worksheet2.CreateArea(2, 4, 2, 5)},
               "MyRange");
        

          Dim rng As Range = wb.CreateNamedRange( _
               New Area(){ _
               worksheet1.CreateArea(2, 4, 2, 5), _
               worksheet2.CreateArea(2, 4, 2, 5)}, _
               "MyRange")