Skip to content

Latest commit

 

History

History
53 lines (32 loc) · 1.44 KB

Excel.Range.SpecialCells.md

File metadata and controls

53 lines (32 loc) · 1.44 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Range.SpecialCells method (Excel)
vbaxl10.chm144203
vbaxl10.chm144203
Excel.Range.SpecialCells
30c2035c-34e3-3b1a-f243-69a9fed97f3b
05/11/2019
medium

Range.SpecialCells method (Excel)

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

Syntax

expression.SpecialCells (Type, Value)

expression A variable that represents a Range object.

Parameters

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

Range

Remarks

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

Example

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

Worksheets("Sheet1").Activate 
ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Activate

[!includeSupport and feedback]