Compartilhar via


Range Object Members

Excel Developer Reference

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

Methods

  Name Description
Bb225606.methods(en-us,office.12).gif Activate Activates a single cell, which must be inside the current selection. To select a range of cells, use the Select method.
Bb225606.methods(en-us,office.12).gif AddComment Adds a comment to the range.
Bb225606.methods(en-us,office.12).gif AdvancedFilter Filters or copies data from a list based on a criteria range. If the initial selection is a single cell, that cell's current region is used.
Bb225606.methods(en-us,office.12).gif ApplyNames Applies names to the cells in the specified range.
Bb225606.methods(en-us,office.12).gif ApplyOutlineStyles Applies outlining styles to the specified range.
Bb225606.methods(en-us,office.12).gif AutoComplete Returns an AutoComplete match from the list. If there’s no AutoComplete match or if more than one entry in the list matches the string to complete, this method returns an empty string.
Bb225606.methods(en-us,office.12).gif AutoFill Performs an autofill on the cells in the specified range.
Bb225606.methods(en-us,office.12).gif AutoFilter Filters a list using the AutoFilter.
Bb225606.methods(en-us,office.12).gif AutoFit Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit.
Bb225606.methods(en-us,office.12).gif AutoOutline Automatically creates an outline for the specified range. If the range is a single cell, Microsoft Excel creates an outline for the entire sheet. The new outline replaces any existing outline.
Bb225606.methods(en-us,office.12).gif BorderAround Adds a border to a range and sets the Color, LineStyle, and Weight properties for the new border. Variant.
Bb225606.methods(en-us,office.12).gif Calculate Calculates all open workbooks, a specific worksheet in a workbook, or a specified range of cells on a worksheet, as shown in the following table.
Bb225606.methods(en-us,office.12).gif CalculateRowMajorOrder Calculates a specfied range of cells.
Bb225606.methods(en-us,office.12).gif CheckSpelling Checks the spelling of an object.
Bb225606.methods(en-us,office.12).gif Clear Clears the entire object.
Bb225606.methods(en-us,office.12).gif ClearComments Clears all cell comments from the specified range.
Bb225606.methods(en-us,office.12).gif ClearContents Clears the formulas from the range.
Bb225606.methods(en-us,office.12).gif ClearFormats Clears the formatting of the object.
Bb225606.methods(en-us,office.12).gif ClearNotes Clears notes and sound notes from all the cells in the specified range.
Bb225606.methods(en-us,office.12).gif ClearOutline Clears the outline for the specified range.
Bb225606.methods(en-us,office.12).gif ColumnDifferences Returns a Range object that represents all the cells whose contents are different from the comparison cell in each column.
Bb225606.methods(en-us,office.12).gif Consolidate Consolidates data from multiple ranges on multiple worksheets into a single range on a single worksheet. Variant.
Bb225606.methods(en-us,office.12).gif Copy Copies the range to the specified range or to the Clipboard.
Bb225606.methods(en-us,office.12).gif CopyFromRecordset Copies the contents of an ADO or DAO Recordset object onto a worksheet, beginning at the upper-left corner of the specified range. If the Recordset object contains fields with OLE objects in them, this method fails.
Bb225606.methods(en-us,office.12).gif CopyPicture Copies the selected object to the Clipboard as a picture. Variant.
Bb225606.methods(en-us,office.12).gif CreateNames Creates names in the specified range, based on text labels in the sheet.
Bb225606.methods(en-us,office.12).gif Cut Cuts the object to the Clipboard or pastes it into a specified destination.
Bb225606.methods(en-us,office.12).gif DataSeries Creates a data series in the specified range. Variant.
Bb225606.methods(en-us,office.12).gif Delete Deletes the object.
Bb225606.methods(en-us,office.12).gif DialogBox Displays a dialog box defined by a dialog box definition table on a Microsoft Excel 4.0 macro sheet. Returns the number of the chosen control, or returns False if the user clicks the Cancel button.
Bb225606.methods(en-us,office.12).gif Dirty Designates a range to be recalculated when the next recalculation occurs.
Bb225606.methods(en-us,office.12).gif EditionOptions You have requested Help for a Visual Basic keyword used only on the Macintosh. For information about this keyword, consult the language reference Help included with Microsoft Office Macintosh Edition.
Bb225606.methods(en-us,office.12).gif ExportAsFixedFormat Exports to a file of the specified format.
Bb225606.methods(en-us,office.12).gif FillDown Fills down from the top cell or cells in the specified range to the bottom of the range. The contents and formatting of the cell or cells in the top row of a range are copied into the rest of the rows in the range.
Bb225606.methods(en-us,office.12).gif FillLeft Fills left from the rightmost cell or cells in the specified range. The contents and formatting of the cell or cells in the rightmost column of a range are copied into the rest of the columns in the range.
Bb225606.methods(en-us,office.12).gif FillRight Fills right from the leftmost cell or cells in the specified range. The contents and formatting of the cell or cells in the leftmost column of a range are copied into the rest of the columns in the range.
Bb225606.methods(en-us,office.12).gif FillUp Fills up from the bottom cell or cells in the specified range to the top of the range. The contents and formatting of the cell or cells in the bottom row of a range are copied into the rest of the rows in the range.
Bb225606.methods(en-us,office.12).gif Find Finds specific information in a range.
Bb225606.methods(en-us,office.12).gif FindNext Continues a search that was begun with the Find method. Finds the next cell that matches those same conditions and returns a Range object that represents that cell. Doesn’t affect the selection or the active cell.
Bb225606.methods(en-us,office.12).gif FindPrevious Continues a search that was begun with the Find method. Finds the previous cell that matches those same conditions and returns a Range object that represents that cell. Doesn’t affect the selection or the active cell.
Bb225606.methods(en-us,office.12).gif FunctionWizard Starts the Function Wizard for the upper-left cell of the range.
Bb225606.methods(en-us,office.12).gif Group 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.
Bb225606.methods(en-us,office.12).gif Insert Inserts a cell or a range of cells into the worksheet or macro sheet and shifts other cells away to make space.
Bb225606.methods(en-us,office.12).gif InsertIndent Adds an indent to the specified range.
Bb225606.methods(en-us,office.12).gif Justify Rearranges the text in a range so that it fills the range evenly.
Bb225606.methods(en-us,office.12).gif ListNames Pastes a list of all nonhidden names onto the worksheet, beginning with the first cell in the range.
Bb225606.methods(en-us,office.12).gif Merge Creates a merged cell from the specified Range object.
Bb225606.methods(en-us,office.12).gif NavigateArrow Navigates a tracer arrow for the specified range to the precedent, dependent, or error-causing cell or cells. Selects the precedent, dependent, or error cells and returns a Range object that represents the new selection. This method causes an error if it's applied to a cell without visible tracer arrows.
Bb225606.methods(en-us,office.12).gif NoteText Returns or sets the cell note associated with the cell in the upper-left corner of the range. Read/write String. Cell notes have been replaced by range comments. For more information, see the Comment object.
Bb225606.methods(en-us,office.12).gif Parse Parses a range of data and breaks it into multiple cells. Distributes the contents of the range to fill several adjacent columns; the range can be no more than one column wide.
Bb225606.methods(en-us,office.12).gif PasteSpecial Pastes a Range from the Clipboard into the specified range.
Bb225606.methods(en-us,office.12).gif PrintOut Prints the object.
Bb225606.methods(en-us,office.12).gif PrintPreview Shows a preview of the object as it would look when printed.
Bb225606.methods(en-us,office.12).gif RemoveDuplicates Removes duplicate values from a range of values.
Bb225606.methods(en-us,office.12).gif RemoveSubtotal Removes subtotals from a list.
Bb225606.methods(en-us,office.12).gif Replace Returns a Boolean indicating characters in cells within the specified range. Using this method doesn’t change either the selection or the active cell.
Bb225606.methods(en-us,office.12).gif RowDifferences Returns a Range object that represents all the cells whose contents are different from those of the comparison cell in each row.
Bb225606.methods(en-us,office.12).gif Run Runs the Microsoft Excel macro at this location. The range must be on a macro sheet.
Bb225606.methods(en-us,office.12).gif Select Selects the object.
Bb225606.methods(en-us,office.12).gif SetPhonetic Creates Phonetic objects for all the cells in the specified range.
Bb225606.methods(en-us,office.12).gif Show Scrolls through the contents of the active window to move the range into view. The range must consist of a single cell in the active document.
Bb225606.methods(en-us,office.12).gif ShowDependents Draws tracer arrows to the direct dependents of the range.
Bb225606.methods(en-us,office.12).gif 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.
Bb225606.methods(en-us,office.12).gif ShowPrecedents Draws tracer arrows to the direct precedents of the range.
Bb225606.methods(en-us,office.12).gif Sort Sorts a range of values.
Bb225606.methods(en-us,office.12).gif SortSpecial Uses East Asian sorting methods to sort the range, 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.
Bb225606.methods(en-us,office.12).gif Speak Causes the cells of the range to be spoken in row order or column order.
Bb225606.methods(en-us,office.12).gif SpecialCells Returns a Range object that represents all the cells that match the specified type and value.
Bb225606.methods(en-us,office.12).gif SubscribeTo You have requested Help for a Visual Basic keyword used only on the Macintosh. For information about this keyword, consult the language reference Help included with Microsoft Office Macintosh Edition.
Bb225606.methods(en-us,office.12).gif Subtotal Creates subtotals for the range (or the current region, if the range is a single cell).
Bb225606.methods(en-us,office.12).gif Table Creates a data table based on input values and formulas that you define on a worksheet.
Bb225606.methods(en-us,office.12).gif TextToColumns Parses a column of cells that contain text into several columns.
Bb225606.methods(en-us,office.12).gif Ungroup Promotes a range in an outline (that is, decreases its outline level). The specified range must be a row or column, or a range of rows or columns. If the range is in a PivotTable report, this method ungroups the items contained in the range.
Bb225606.methods(en-us,office.12).gif UnMerge Separates a merged area into individual cells.

Properties

  Name Description
Bb225606.properties(en-us,office.12).gif AddIndent Returns or sets a Variant value that indicates if text is automatically indented when the text alignment in a cell is set to equal distribution (either horizontally or vertically.)
Bb225606.properties(en-us,office.12).gif Address Returns a String value that represents the range reference in the language of the macro.
Bb225606.properties(en-us,office.12).gif AddressLocal Returns the range reference for the specified range in the language of the user. Read-only String.
Bb225606.properties(en-us,office.12).gif AllowEdit Returns a Boolean value that indicates if the range can be edited on a protected worksheet.
Bb225606.properties(en-us,office.12).gif Application When used without an object qualifier, this property returns an Application object that represents the Microsoft Excel application. When used with an object qualifier, this property returns an Application object that represents the creator of the specified object (you can use this property with an OLE Automation object to return the application of that object). Read-only.
Bb225606.properties(en-us,office.12).gif Areas Returns an Areas collection that represents all the ranges in a multiple-area selection. Read-only.
Bb225606.properties(en-us,office.12).gif 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).
Bb225606.properties(en-us,office.12).gif Cells Returns a Range object that represents the cells in the specified range.
Bb225606.properties(en-us,office.12).gif Characters Returns a Characters object that represents a range of characters within the object text. You can use the Characters object to format characters within a text string.
Bb225606.properties(en-us,office.12).gif Column Returns the number of the first column in the first area in the specified range. Read-only Long.
Bb225606.properties(en-us,office.12).gif Columns Returns a Range object that represents the columns in the specified range.
Bb225606.properties(en-us,office.12).gif ColumnWidth Returns or sets the width of all columns in the specified range. Read/write Variant.
Bb225606.properties(en-us,office.12).gif Comment Returns a Comment object that represents the comment associated with the cell in the upper-left corner of the range.
Bb225606.properties(en-us,office.12).gif Count Returns a Long value that represents the number of objects in the collection.
Bb225606.properties(en-us,office.12).gif CountLarge Counts the largest value in a given range of values. Read-only Variant.
Bb225606.properties(en-us,office.12).gif Creator Returns a 32-bit integer that indicates the application in which this object was created. Read-only Long.
Bb225606.properties(en-us,office.12).gif CurrentArray If the specified cell is part of an array, returns a Range object that represents the entire array. Read-only.
Bb225606.properties(en-us,office.12).gif CurrentRegion Returns a Range object that represents the current region. The current region is a range bounded by any combination of blank rows and blank columns. Read-only.
Bb225606.properties(en-us,office.12).gif Dependents Returns a Range object that represents the range containing all the dependents of a cell. This can be a multiple selection (a union of Range objects) if there’s more than one dependent. Read-only Range object.
Bb225606.properties(en-us,office.12).gif DirectDependents Returns a Range object that represents the range containing all the direct dependents of a cell. This can be a multiple selection (a union of Range objects) if there’s more than one dependent. Read-only Range object.
Bb225606.properties(en-us,office.12).gif DirectPrecedents Returns a Range object that represents the range containing all the direct precedents of a cell. This can be a multiple selection (a union of Range objects) if there’s more than one precedent. Read-only Range object.
Bb225606.properties(en-us,office.12).gif End Returns a Range object that represents the cell at the end of the region that contains the source range. Equivalent to pressing END+UP ARROW, END+DOWN ARROW, END+LEFT ARROW, or END+RIGHT ARROW. Read-only Range object.
Bb225606.properties(en-us,office.12).gif EntireColumn Returns a Range object that represents the entire column (or columns) that contains the specified range. Read-only.
Bb225606.properties(en-us,office.12).gif EntireRow Returns a Range object that represents the entire row (or rows) that contains the specified range. Read-only.
Bb225606.properties(en-us,office.12).gif Errors Allows the user to to access error checking options.
Bb225606.properties(en-us,office.12).gif Font Returns a Font object that represents the font of the specified object.
Bb225606.properties(en-us,office.12).gif FormatConditions Returns a FormatConditions collection that represents all the conditional formats for the specified range. Read-only.
Bb225606.properties(en-us,office.12).gif Formula Returns or sets a Variant value that represents the object's formula in A1-style notation and in the language of the macro.
Bb225606.properties(en-us,office.12).gif FormulaArray Returns or sets the array formula of a range. Returns (or can be set to) a single formula or a Visual Basic array. If the specified range doesn't contain an array formula, this property returns null. Read/write Variant.
Bb225606.properties(en-us,office.12).gif FormulaHidden Returns or sets a Variant value that indicates if the formula will be hidden when the worksheet is protected.
Bb225606.properties(en-us,office.12).gif FormulaLocal Returns or sets the formula for the object, using A1-style references in the language of the user. Read/write Variant.
Bb225606.properties(en-us,office.12).gif FormulaR1C1 Returns or sets the formula for the object, using R1C1-style notation in the language of the macro. Read/write Variant.
Bb225606.properties(en-us,office.12).gif FormulaR1C1Local Returns or sets the formula for the object, using R1C1-style notation in the language of the user. Read/write Variant.
Bb225606.properties(en-us,office.12).gif HasArray True if the specified cell is part of an array formula. Read-only Variant.
Bb225606.properties(en-us,office.12).gif HasFormula True if all cells in the range contain formulas; False if none of the cells in the range contains a formula; null otherwise. Read-only Variant.
Bb225606.properties(en-us,office.12).gif Height Returns or sets a Variant value that represents the height, in points, of the range.
Bb225606.properties(en-us,office.12).gif Hidden Returns or sets a Variant value that indicates if the rows or columns are hidden.
Bb225606.properties(en-us,office.12).gif HorizontalAlignment Returns or sets a Variant value that represents the horizontal alignment for the specified object.
Bb225606.properties(en-us,office.12).gif Hyperlinks Returns a Hyperlinks collection that represents the hyperlinks for the range.
Bb225606.properties(en-us,office.12).gif ID Returns or sets a String value that represents the identifying label for the specified cell when the page is saved as a Web page.
Bb225606.properties(en-us,office.12).gif IndentLevel Returns or sets a Variant value that represents the indent level for the cell or range. Can be an integer from 0 to 15.
Bb225606.properties(en-us,office.12).gif Interior Returns an Interior object that represents the interior of the specified object.
Bb225606.properties(en-us,office.12).gif Item Returns a Range object that represents a range at an offset to the specified range.
Bb225606.properties(en-us,office.12).gif Left Returns a Variant value that represents the distance, in points, from the left edge of column A to the left edge of the range.
Bb225606.properties(en-us,office.12).gif ListHeaderRows Returns the number of header rows for the specified range. Read-only Long.
Bb225606.properties(en-us,office.12).gif ListObject Returns a ListObject object for the Range object. Read-only ListObject object.
Bb225606.properties(en-us,office.12).gif LocationInTable Returns a constant that describes the part of the PivotTable report that contains the upper-left corner of the specified range. Can be one of the following XlLocationInTable. constants. Read-only Long.
Bb225606.properties(en-us,office.12).gif Locked Returns or sets a Variant value that indicates if the object is locked.
Bb225606.properties(en-us,office.12).gif MDX Returns the MDX name for the specified Range object. Read-only String.
Bb225606.properties(en-us,office.12).gif MergeArea Returns a Range object that represents the merged range containing the specified cell. If the specified cell isn’t in a merged range, this property returns the specified cell. Read-only Variant.
Bb225606.properties(en-us,office.12).gif MergeCells True if the range contains merged cells. Read/write Variant.
Bb225606.properties(en-us,office.12).gif Name Returns or sets a Variant value that represents the name of the object.
Bb225606.properties(en-us,office.12).gif Next Returns a Range object that represents the next cell.
Bb225606.properties(en-us,office.12).gif NumberFormat Returns or sets a Variant value that represents the format code for the object.
Bb225606.properties(en-us,office.12).gif NumberFormatLocal Returns or sets a Variant value that represents the format code for the object as a string in the language of the user.
Bb225606.properties(en-us,office.12).gif Offset Returns a Range object that represents a range that’s offset from the specified range.
Bb225606.properties(en-us,office.12).gif Orientation Returns or sets a Variant value that represents the text orientation.
Bb225606.properties(en-us,office.12).gif OutlineLevel Returns or sets the current outline level of the specified row or column. Read/write Variant.
Bb225606.properties(en-us,office.12).gif PageBreak Returns or sets the location of a page break. Can be one of the following XlPageBreak constants: xlPageBreakAutomatic, xlPageBreakManual, or xlPageBreakNone. Read/write Long.
Bb225606.properties(en-us,office.12).gif Parent Returns the parent object for the specified object. Read-only.
Bb225606.properties(en-us,office.12).gif Phonetic Returns the Phonetic object, which contains information about a specific phonetic text string in a cell.
Bb225606.properties(en-us,office.12).gif Phonetics Returns the Phonetics collection of the range. Read only.
Bb225606.properties(en-us,office.12).gif PivotCell Returns a PivotCell object that represents a cell in a PivotTable report.
Bb225606.properties(en-us,office.12).gif PivotField Returns a PivotField object that represents the PivotTable field containing the upper-left corner of the specified range.
Bb225606.properties(en-us,office.12).gif PivotItem Returns a PivotItem object that represents the PivotTable item containing the upper-left corner of the specified range.
Bb225606.properties(en-us,office.12).gif PivotTable Returns a PivotTable object that represents the PivotTable report containing the upper-left corner of the specified range.
Bb225606.properties(en-us,office.12).gif Precedents Returns a Range object that represents all the precedents of a cell. This can be a multiple selection (a union of Range objects) if there's more than one precedent. Read-only.
Bb225606.properties(en-us,office.12).gif PrefixCharacter Returns the prefix character for the cell. Read-only Variant.
Bb225606.properties(en-us,office.12).gif Previous Returns a Range object that represents the next cell.
Bb225606.properties(en-us,office.12).gif QueryTable Returns a QueryTable object that represents the query table that intersects the specified Range object.
Bb225606.properties(en-us,office.12).gif Range Returns a Range object that represents a cell or a range of cells.
Bb225606.properties(en-us,office.12).gif ReadingOrder Returns or sets the reading order for the specified object. Can be one of the following constants: xlRTL (right-to-left), xlLTR (left-to-right), or xlContext. Read/write Long.
Bb225606.properties(en-us,office.12).gif Resize Resizes the specified range. Returns a Range object that represents the resized range.
Bb225606.properties(en-us,office.12).gif Row Returns the number of the first row of the first area in the range. Read-only Long.
Bb225606.properties(en-us,office.12).gif RowHeight Returns the height of all the rows in the range specified, measured in points. Returns null if the rows in the specified range aren’t all the same height. Read/write Variant.
Bb225606.properties(en-us,office.12).gif Rows Returns a Range object that represents the rows in the specified range. Read-only Range object.
Bb225606.properties(en-us,office.12).gif ServerActions Specifies the actions that can be performed on the SharePoint server for a Range object.
Bb225606.properties(en-us,office.12).gif ShowDetail True if the outline is expanded for the specified range (so that the detail of the column or row is visible). The specified range must be a single summary column or row in an outline. Read/write Variant. For the PivotItem object (or the Range object if the range is in a PivotTable report), this property is set to True if the item is showing detail.
Bb225606.properties(en-us,office.12).gif ShrinkToFit Returns or sets a Variant value that indicates.
Bb225606.properties(en-us,office.12).gif SmartTags Returns a SmartTags object representing the identifier for the specified cell.
Bb225606.properties(en-us,office.12).gif SoundNote This property should not be used. Sound notes have been removed from Microsoft Excel.
Bb225606.properties(en-us,office.12).gif Style Returns or sets a Variant value, containing a Style object, that represents the style of the specified range.
Bb225606.properties(en-us,office.12).gif Summary True if the range is an outlining summary row or column. The range should be a row or a column. Read-only Variant.
Bb225606.properties(en-us,office.12).gif Text Returns or sets the text for the specified object. Read-only String.
Bb225606.properties(en-us,office.12).gif Top Returns a Variant value that represents the distance, in points, from the top edge of row 1 to the top edge of the range.
Bb225606.properties(en-us,office.12).gif UseStandardHeight True if the row height of the Range object equals the standard height of the sheet. Returns Null if the range contains more than one row and the rows aren’t all the same height. Read/write Variant.
Bb225606.properties(en-us,office.12).gif UseStandardWidth True if the column width of the Range object equals the standard width of the sheet. Returns null if the range contains more than one column and the columns aren’t all the same width. Read/write Variant.
Bb225606.properties(en-us,office.12).gif Validation Returns the Validation object that represents data validation for the specified range. Read-only.
Bb225606.properties(en-us,office.12).gif Value Returns or sets a Variant value that represents the value of the specified range.
Bb225606.properties(en-us,office.12).gif Value2 Returns or sets the cell value. Read/write Variant.
Bb225606.properties(en-us,office.12).gif VerticalAlignment Returns or sets a Variant value that represents the vertical alignment of the specified object.
Bb225606.properties(en-us,office.12).gif Width Returns a Variant value that represents the width, in units, of the range.
Bb225606.properties(en-us,office.12).gif Worksheet Returns a Worksheet object that represents the worksheet containing the specified range. Read-only.
Bb225606.properties(en-us,office.12).gif WrapText Returns or sets a Variant value that indicates if Microsoft Excel wraps the text in the object.
Bb225606.properties(en-us,office.12).gif XPath Returns an XPath object that represents the Xpath of the element mapped to the specified Range object. The context of the range determines whether or not the action succeeds or returns an empty object. Read-only.