Modifica

Condividi tramite


Range Interface

Definition

Represents a cell, a row, a column, a selection of cells containing one or more contiguous blocks of cells, or a 3-D range.

public interface class Range : System::Collections::IEnumerable
[System.Runtime.InteropServices.Guid("00020846-0000-0000-C000-000000000046")]
[System.Runtime.InteropServices.InterfaceType(2)]
public interface Range : System.Collections.IEnumerable
Public Interface Range
Implements IEnumerable
Attributes
Implements

Properties

_Default[Object, Object]

Reserved for internal use.

AddIndent

Determines if text is automatically indented when the text alignment in a cell is set to equal distribution either horizontally or vertically.

Address[Object, Object, XlReferenceStyle, Object, Object]

Returns the range reference.

AddressLocal[Object, Object, XlReferenceStyle, Object, Object]

Returns the range reference for the specified range in the language of the user.

AllowEdit

Determines if the range can be edited on a protected worksheet.

Application

Returns an Application object that represents the Microsoft Excel application.

Areas

Returns an Areas collection that represents all the ranges in a multiple-area selection.

Borders

Returns a Borders collection that represents the borders of a style or a range of cells (including a range defined as part of a conditional format).

Cells

Returns a Range object that represents the cells in the specified range.

Characters[Object, Object]

Returns a Characters object that represents a range of characters within the object text.

Column

Returns the number of the first column in the first area in the specified range.

Columns

Returns a Range object that represents the columns in the specified range.

ColumnWidth

Returns or sets the width of all columns in the specified range.

Comment

Returns a Comment object that represents the comment associated with the cell in the upper-left corner of the range.

Count

Returns the number of objects in the collection.

CountLarge

Counts the largest value in a given Range of values. Read-only.

Creator

Returns a 32-bit integer that indicates the application in which this object was created.

CurrentArray

If the specified cell is part of an array, returns a Range object that represents the entire array.

CurrentRegion

Returns a Range object that represents the current region.

Dependents

Returns a Range object that represents the range containing all the dependents of a cell.

DirectDependents

Returns a Range object that represents the range containing all the direct dependents of a cell.

DirectPrecedents

Returns a Range object that represents the range containing all the direct precedents of a cell.

DisplayFormat

Gets a DisplayFormat object that represents the display settings for the specified range.

End[XlDirection]

Returns a Range object that represents the cell at the end of the region that contains the source range.

EntireColumn

Returns a Range object that represents the entire column (or columns) that contains the specified range.

EntireRow

Returns a Range object that represents the entire row (or rows) that contains the specified range.

Errors

Allows the user to access error checking options.

Font

Returns a Font object that represents the font of the specified object.

FormatConditions

Returns a FormatConditions collection that represents all the conditional formats for the specified range.

Formula

Returns or sets the object's formula in A1-style notation and in the language of the macro.

FormulaArray

Returns or sets the array formula of a range.

FormulaHidden

Determines if the formula will be hidden when the worksheet is protected.

FormulaLabel

Returns or sets the formula label type for the specified range.

FormulaLocal

Returns or sets the formula for the object, using A1-style references in the language of the user.

FormulaR1C1

Returns or sets the formula for the object, using R1C1-style notation in the language of the macro.

FormulaR1C1Local

Returns or sets the formula for the object, using R1C1-style notation in the language of the user.

HasArray

Determines if the specified cell is part of an array formula.

HasFormula

Determines if all cells in the range contain formulas.

Height

The height of the range.

Hidden

Determines if the rows or columns are hidden.

HorizontalAlignment

Returns or sets the horizontal alignment for the specified object.

Hyperlinks

Returns a Hyperlinks collection that represents the hyperlinks for the range.

ID

Returns or sets the identifying label for the specified cell when the page is saved as a Web page.

IndentLevel

Returns or sets the indent level for the cell or range.

Interior

Returns an Interior object that represents the interior of the specified object.

Item[Object, Object]

Returns a Range object that represents a range at an offset to the specified range.

Left

The distance from the left edge of column A to the left edge of the range.

ListHeaderRows

Returns the number of header rows for the specified range.

ListObject

Returns a ListObject object for the Range object or QueryTable object.

LocationInTable

Returns a constant that describes the part of the PivotTable report that contains the upper-left corner of the specified range.

Locked

Determines if the object is locked.

MDX

Returns the MDX name for the specified Range object. Read-only.

MergeArea

Returns a Range object that represents the merged range containing the specified cell.

MergeCells

Determines if the range or style contains merged cells.

Name

Returns or sets the name of the object.

Next

Returns a Range object that represents the next cell.

NumberFormat

Returns or sets the format code for the object.

NumberFormatLocal

Returns or sets the format code for the object as a string in the language of the user.

Offset[Object, Object]

Returns a Range object that represents a range that’s offset from the specified range.

Orientation

Returns the text orientation.

OutlineLevel

Returns or sets the current outline level of the specified row or column.

PageBreak

Returns or sets the location of a page break.

Parent

Returns the parent object for the specified object.

Phonetic

Returns the Phonetic object which contains information about a specific phonetic text string in a cell.

Phonetics

Returns the Phonetics collection of the range.

PivotCell

Returns a PivotCell object that represents a cell in a PivotTable report.

PivotField

Returns a PivotField object that represents the PivotTable field containing the upper-left corner of the specified range.

PivotItem

Returns a PivotItem object that represents the PivotTable item containing the upper-left corner of the specified range.

PivotTable

Returns a PivotTable object that represents the PivotTable report containing the upper-left corner of the specified range, or the PivotTable report associated with the PivotChart report.

Precedents

Returns a Range object that represents all the precedents of a cell.

PrefixCharacter

Returns the prefix character for the cell.

Previous

Returns a Range object that represents the previous cell.

QueryTable

Returns a QueryTable object that represents the query table that intersects the specified Range object.

Range[Object, Object]

Returns a Range object that represents a cell or a range of cells.

ReadingOrder

Returns or sets the reading order for the specified object.

Resize[Object, Object]

Resizes the specified range.

Row

Returns the number of the first row of the first area in the range.

RowHeight

Returns the height of all the rows in the range specified, measured in points.

Rows

Returns a Range object that represents the rows in the specified range.

ServerActions

Specifies the actions that can be performed on the SharePoint server for a Range object.

ShowDetail

Returns True if the outline is expanded for the specified range (so that the detail of the column or row is visible).

ShrinkToFit

Determines if text automatically shrinks to fit in the available column width.

SmartTags

Returns a SmartTags object representing the identifier for the specified cell.

SoundNote

This property should not be used. Sound notes have been removed from Microsoft Excel.

SparklineGroups

Gets a SparklineGroups object that represents an existing group of sparklines from the specified range.

Style

Returns a Style object that represents the style of the specified range.

Summary

Determines if the range is an outlining summary row or column.

Text

Returns or sets the text for the specified object.

Top

Returns the distance, in points, from the top edge of row 1 to the top edge of the range.

UseStandardHeight

Determines if the row height of the Range object equals the standard height of the sheet.

UseStandardWidth

Determines if the column width of the Range object equals the standard width of the sheet.

Validation

Returns the Validation object that represents data validation for the specified range.

Value[Object]

Returns or sets the value of the specified range.

Value2

Returns or sets the cell value.

VerticalAlignment

Returns or sets the vertical alignment of the specified object.

Width

The width, in points, of the range.

Worksheet

Returns a Worksheet object that represents the worksheet containing the specified range.

WrapText

Determines if Microsoft Excel wraps the text in the object.

XPath

Returns an XPath object that represents the Xpath of the element mapped to the specified Range object.

Methods

_PasteSpecial(XlPasteType, XlPasteSpecialOperation, Object, Object)

Reserved for internal use.

_PrintOut(Object, Object, Object, Object, Object, Object, Object)

Reserved for internal use.

Activate()

Activates a single cell, which must be inside the current selection.

AddComment(Object)

Adds a comment to the range.

AdvancedFilter(XlFilterAction, Object, Object, Object)

Filters or copies data from a list based on a criteria range.

AllocateChanges()

Performs a writeback operation for all edited cells in a range based on an OLAP data source.

ApplyNames(Object, Object, Object, Object, Object, XlApplyNamesOrder, Object)

Applies names to the cells in the specified range.

ApplyOutlineStyles()

Applies outlining styles to the specified range.

AutoComplete(String)

Returns an AutoComplete match from the list.

AutoFill(Range, XlAutoFillType)

Performs an autofill on the cells in the specified range.

AutoFilter(Object, Object, XlAutoFilterOperator, Object, Object)

Filters a list using the AutoFilter.

AutoFit()

Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit.

AutoFormat(XlRangeAutoFormat, Object, Object, Object, Object, Object, Object)

Automatically formats the specified range, using a predefined format.

AutoOutline()

Automatically creates an outline for the specified range.

BorderAround(Object, XlBorderWeight, XlColorIndex, Object)

Adds a border to a range and sets the Color, LineStyle, and Weight properties for the new border.

BorderAround2(Object, XlBorderWeight, XlColorIndex, Object, Object)

Reserved for internal use.

Calculate()

Calculates a specified range of cells on a worksheet.

CalculateRowMajorOrder()

Calculates a specfied range of cells.

CheckSpelling(Object, Object, Object, Object)

Checks the spelling of an object.

Clear()

Clears the entire object.

ClearComments()

Clears all cell comments from the specified range.

ClearContents()

Clears the formulas from the range.

ClearFormats()

Clears the formatting of the object.

ClearHyperlinks()

Removes all hyperlinks from the specified range.

ClearNotes()

Clears notes and sound notes from all the cells in the specified range.

ClearOutline()

Clears the outline for the specified range.

ColumnDifferences(Object)

Returns a Range object that represents all the cells whose contents are different from the comparison cell in each column.

Consolidate(Object, Object, Object, Object, Object)

Consolidates data from multiple ranges on multiple worksheets into a single range on a single worksheet.

Copy(Object)

Copies the range to the specified range or to the Clipboard.

CopyFromRecordset(Object, Object, Object)

Copies the contents of an ADO or DAO Recordset object onto a worksheet, beginning at the upper-left corner of the specified range.

CopyPicture(XlPictureAppearance, XlCopyPictureFormat)

Copies the selected object to the Clipboard as a picture.

CreateNames(Object, Object, Object, Object)

Creates names in the specified range, based on text labels in the sheet.

CreatePublisher(Object, XlPictureAppearance, Object, Object, Object, Object)

You have requested Help for a keyword used only on the Macintosh. For information about this keyword, consult the language reference Help included with Microsoft Office Macintosh Edition.

Cut(Object)

Cuts the object to the Clipboard or pastes it into a specified destination.

DataSeries(Object, XlDataSeriesType, XlDataSeriesDate, Object, Object, Object)

Creates a data series in the specified range.

Delete(Object)

Deletes the object.

DialogBox()

Displays a dialog box defined by a dialog box definition table on a Microsoft Excel 4.0 macro sheet.

Dirty()

Designates a range to be recalculated when the next recalculation occurs.

DiscardChanges()

Discards all changes in the edited cells of the range.

EditionOptions(XlEditionType, XlEditionOptionsOption, Object, Object, XlPictureAppearance, XlPictureAppearance, Object)

You have requested Help for a keyword used only on the Macintosh. For information about this keyword, consult the language reference Help included with Microsoft Office Macintosh Edition.

ExportAsFixedFormat(XlFixedFormatType, Object, Object, Object, Object, Object, Object, Object, Object)

Exports to a file of the specified format.

FillDown()

Fills down from the top cell or cells in the specified range to the bottom of the range.

FillLeft()

Fills left from the rightmost cell or cells in the specified range.

FillRight()

Fills right from the leftmost cell or cells in the specified range.

FillUp()

Fills up from the bottom cell or cells in the specified range to the top of the range.

Find(Object, Object, Object, Object, Object, XlSearchDirection, Object, Object, Object)

Finds specific information in a range and returns a Range object that represents the first cell where that information is found.

FindNext(Object)

Continues a search that was begun with the Find(Object, Object, Object, Object, Object, XlSearchDirection, Object, Object, Object) method.

FindPrevious(Object)

Continues a search that was begun with the Find(Object, Object, Object, Object, Object, XlSearchDirection, Object, Object, Object) method.

FlashFill()

TRUE indicates that the Excel Flash Fill feature has been enabled and active.

FunctionWizard()

Starts the Function Wizard for the upper-left cell of the range.

GetEnumerator()
GoalSeek(Object, Range)

Calculates the values necessary to achieve a specific goal.

Group(Object, Object, Object, Object)

When the Range object represents a single cell in a PivotTable field’s data range, the Group method performs numeric or date-based grouping in that field.

Insert(Object, Object)

Inserts a cell or a range of cells into the worksheet or macro sheet and shifts other cells away to make space.

InsertIndent(Int32)

Adds an indent to the specified range.

Justify()

Rearranges the text in a range so that it fills the range evenly.

ListNames()

Pastes a list of all displayed names onto the worksheet, beginning with the first cell in the range.

Merge(Object)

Creates a merged cell from the specified Range object.

NavigateArrow(Object, Object, Object)

Navigates a tracer arrow for the specified range to the precedent, dependent, or error-causing cell or cells.

NoteText(Object, Object, Object)

Returns or sets the cell note associated with the cell in the upper-left corner of the range.

Parse(Object, Object)

Parses a range of data and breaks it into multiple cells.

PasteSpecial(XlPasteType, XlPasteSpecialOperation, Object, Object)

Pastes a Range from the Clipboard into the specified range.

PrintOut(Object, Object, Object, Object, Object, Object, Object, Object)

Prints the object.

PrintOutEx(Object, Object, Object, Object, Object, Object, Object, Object)

Reserved for internal use.

PrintPreview(Object)

Shows a preview of the object as it would look when printed.

RemoveDuplicates(Object, XlYesNoGuess)

Removes duplicate values from a range of values.

RemoveSubtotal()

Removes subtotals from a list.

Replace(Object, Object, Object, Object, Object, Object, Object, Object)

Returns a Boolean indicating characters in cells within the specified range.

RowDifferences(Object)

Returns a Range object that represents all the cells whose contents are different from those of the comparison cell in each row.

Run(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

Runs the Microsoft Excel macro at this location.

Select()

Selects the object.

SetPhonetic()

Creates Phonetic objects for all the cells in the specified range.

Show()

Scrolls through the contents of the active window to move the range into view.

ShowDependents(Object)

Draws tracer arrows to the direct dependents of the range.

ShowErrors()

Draws tracer arrows through the precedents tree to the cell that’s the source of the error and returns the range that contains that cell.

ShowPrecedents(Object)

Draws tracer arrows to the direct precedents of the range.

Sort(Object, XlSortOrder, Object, Object, XlSortOrder, Object, XlSortOrder, XlYesNoGuess, Object, Object, XlSortOrientation, XlSortMethod, XlSortDataOption, XlSortDataOption, XlSortDataOption)

Sorts a PivotTable report, a range, or the active region if the specified range contains only one cell.

SortSpecial(XlSortMethod, Object, XlSortOrder, Object, Object, XlSortOrder, Object, XlSortOrder, XlYesNoGuess, Object, Object, XlSortOrientation, XlSortDataOption, XlSortDataOption, XlSortDataOption)

Uses East Asian sorting methods to sort the range or a PivotTable report, or uses the method for the active region if the range contains only one cell. For example, Japanese sorts in the order of the Kana syllabary.

Speak(Object, Object)

Causes the cells of the range to be spoken in row order or column order.

SpecialCells(XlCellType, Object)

Returns a Range object that represents all the cells that match the specified type and value.

SubscribeTo(String, XlSubscribeToFormat)

You have requested Help for a keyword used only on the Macintosh. For information about this keyword, consult the language reference Help included with Microsoft Office Macintosh Edition.

Subtotal(Int32, XlConsolidationFunction, Object, Object, Object, XlSummaryRow)

Creates subtotals for the range (or the current region, if the range is a single cell).

Table(Object, Object)

Creates a data table based on input values and formulas that you define on a worksheet.

TextToColumns(Object, XlTextParsingType, XlTextQualifier, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

Parses a column of cells that contain text into several columns.

Ungroup()

Promotes a range in an outline (that is, decreases its outline level).

UnMerge()

Separates a merged area into individual cells.

Applies to