Range.SpecialCells (Excel)

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

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

SpecialCells (Type, Value)


Dim rngSpecialCells As Range
Set rngSpecialCells = ActiveCell.SpecialCells(Type:=xlCellTypeAllFormatConditions)

Arguments

The following argument is required

Type (XlCellType) - The cells to include.

Here you can find possible values for XlCellType

Optional arguments

The following argument is optional

Value (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.