Show code in...     

  

 

Object Model ExcelApplication Worksheets Worksheet Cells Cell Range
Charts Chart SeriesCollection Series 3DProperties Axis ChartFrame Line Area
PivotField PivotFields PivotTable PivotTables
Style Characters Font Pictures Picture DocumentProperties PageSetup


ExcelApplication Object Reference

NamedRange Method


Syntax:
[VBScript]
Function NamedRange(Name As String,_
	[WorksheetIndex As Long = -1]) As SARange
Description:

Takes a range's Name and returns the Range object.

Parameters:
  • Name
    The Name of the Range object.


  • WorksheetIndex
    Index of the worksheet that contains the Range object.
Example:

The following returns the number of Areas within the "Headings" range.

[VBScript]
Set Range1 = ws.Cells.Range(1,1,1,4)
Range1.Name = "Headings"
NumHeadingsAreas = xlw.NamedRange("Headings",1).AreaCount

Top


Copyright © 2005, SoftArtisans, Inc.