Application ConvertFormula Method Method

Purpose

Converts cell references in a formula between the A1 and R1C1 reference styles, between relative and absolute references, or both. Variant.

Syntax

ConvertFormula(Formula, FromReferenceStyle, ToReferenceStyle, ToAbsolute, RelativeTo)

Required Parameters

Formula

A string that containis the formula you want to convert. This must be a valid formula, and it must begin with an equal sign.

FromReferenceStyle

The reference style of the formula.

Optional Parameters

ToReferenceStyle

A constant of XlReferenceStyle specifying the reference style you want returned. If this argument is omitted, the reference style isn't changed; the formula stays in the style specified by FromReferenceStyle.

ToAbsolute

A constant of XlReferenceStyle which specifies the converted reference type. If this argument is omitted, the reference type isn't changed.

RelativeTo

A Range object that contains one cell. Relative references relate to this cell.