Range.RowDifferences method (Excel)

Returns a Range object that represents all the cells whose contents are different from those of the comparison cell in each row.

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.

Worksheets("Sheet1").Activate 
Set c1 = ActiveSheet.Rows(1).RowDifferences( _ 
 comparison:=ActiveSheet.Range("D1")) 
c1.Select

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.