_Application.ConvertFormula method

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

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

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

Parameters

Formula
Type: System.Object

Required Object. A String that contains the formula you want to convert. This must be a valid formula, and it must begin with an equal sign.

FromReferenceStyle
Type: Microsoft.Office.Interop.Excel.XlReferenceStyle

Required XlReferenceStyle. The reference style of the formula.

XlReferenceStyle can be one of these XlReferenceStyle constants:

xlA1

xlR1C1

ToReferenceStyle
Type: System.Object

Optional XlReferenceStyle. 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.

XlReferenceStyle can be one of these XlReferenceStyle constants.

xlA1

xlR1C1

ToAbsolute
Type: System.Object

Optional XlReferenceStyle. Specifies the converted reference type. If this argument is omitted, the reference type isn't changed.

XlReferenceStyle can be one of these XlReferenceStyle constants:

xlAbsolute

xlAbsRowRelColumn

xlRelRowAbsColumn

xlRelative

RelativeTo
Type: System.Object

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

Return value

Type: System.Object
Show: