Syntax

expression.RowDifferences(Comparison)

expression A variable that represents a Range object.

Parameters

Name Required/Optional Data Type Description
Comparison Required Variant A single cell to compare with the specified range.

Return Value
Range

Example

This example selects the cells in row one on Sheet1 whose contents are different from those of cell D1.

Visual Basic for Applications
Worksheets("Sheet1").Activate Set c1 = ActiveSheet.Rows(1).RowDifferences( _ comparison:=ActiveSheet.Range("D1")) c1.Select
compare row data Get all cells not equal to a base cell. return all different cells in row ROW Row differences row differences Row Differences Method RowDifferences RowDifferences Method

See also: