Syntax

expression.ColumnDifferences(Comparison)

expression A variable that represents a Range object.

Parameters

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

Return Value
Range

Example

This example selects the cells in column A on Sheet1 whose contents are different from cell A4.

Visual Basic for Applications
Worksheets("Sheet1").Activate Set r1 = ActiveSheet.Columns("A").ColumnDifferences( _ Comparison:=ActiveSheet.Range("A4")) r1.Select
column column differences Column Differences Method Columndifferences ColumnDifferences Method compare column data Get all cells not equal to a base cell. return all different cells in column

See also: