Range.SpecialCells Method
Returns a Range object that represents all the cells that match the specified type and value.
Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)
Syntax
'Declaration
Function SpecialCells ( _
Type As XlCellType, _
Value As Object _
) As Range
'Usage
Dim instance As Range
Dim Type As XlCellType
Dim Value As Object
Dim returnValue As Range
returnValue = instance.SpecialCells(Type, _
Value)
Range SpecialCells(
XlCellType Type,
Object Value
)
Parameters
Type
Type: Microsoft.Office.Interop.Excel.XlCellTypeRequired XlCellType. The cells to include. Can be one of the following XlCellType constants:
xlCellTypeAllFormatConditions. Cells of any format.
xlCellTypeAllValidation. Cells having validation criteria.
xlCellTypeBlanks. Empty cells.
xlCellTypeComments. Cells containing notes.
xlCellTypeConstants. Cells containing constants.
xlCellTypeFormulas. Cells containing formulas.
xlCellTypeLastCell. The last cell in the used range.
xlCellTypeSameFormatConditions. Cells having the same format.
xlCellTypeSameValidation. Cells having the same validation criteria.
xlCellTypeVisible. All visible cells.
Value
Type: System.ObjectOptional Object. 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. Can be one of the following XlSpecialCellsValue constants:
xlErrors
xlLogical
xlNumbers
xlTextValues
Return Value
Type: Microsoft.Office.Interop.Excel.Range