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



xlCellType constants Value
xlCellTypeAllFormatConditions. Cells of any format -4172
xlCellTypeAllValidation. Cells having validation criteria -4174
xlCellTypeBlanks. Empty cells 4
xlCellTypeComments. Cells containing notes -4144
xlCellTypeConstants. Cells containing constants 2
xlCellTypeFormulas. Cells containing formulas -4123
xlCellTypeLastCell. The last cell in the used range 11
xlCellTypeSameFormatConditions. Cells having the same format -4173
xlCellTypeSameValidation. Cells having the same validation criteria -4175
xlCellTypeVisible. All visible cells 12
** XlSpecialCellsValue constants** Value
xlErrors 16
xlLogical 4
xlNumbers 1
xlTextValues 2


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


See also

Range Object