Bewerken

Delen via


_Application.ConvertFormula Method

Definition

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

public object ConvertFormula (object Formula, Microsoft.Office.Interop.Excel.XlReferenceStyle FromReferenceStyle, object ToReferenceStyle, object ToAbsolute, object RelativeTo);
Public Function ConvertFormula (Formula As Object, FromReferenceStyle As XlReferenceStyle, Optional ToReferenceStyle As Object, Optional ToAbsolute As Object, Optional RelativeTo As Object) As Object

Parameters

Formula
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
XlReferenceStyle

Required XlReferenceStyle. The reference style of the formula.XlReferenceStyle can be one of these XlReferenceStyle constants:xlA1xlR1C1

ToReferenceStyle
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
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:xlAbsolutexlAbsRowRelColumnxlRelRowAbsColumnxlRelative

RelativeTo
Object

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

Returns

Applies to