Range.SpecialCells method (Excel)

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


expression.SpecialCells (Type, Value)

expression A variable that represents a Range object.


Name Required/Optional Data type Description
Type Required XlCellType The cells to include.
Value Optional Variant If Type is either xlCellTypeConstants or xlCellTypeFormulas, this argument is used to determine which types of cells to include in the result. These values can be added together to return more than one type. The default is to select all constants or formulas, no matter what the type.

Return value



Use the XlSpecialCellsValue enumeration to specify cells with a particular type of value to include in the result.


This example selects the last cell in the used range of Sheet1.


Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.