Name
Application.ConvertFormula(Formula, FromReferenceStyle, [ToReferenceStyle], [ToAbsolute], [RelativeTo])
Synopsis
Converts cell references in a formula between the A1 and R1C1 reference styles, between relative and absolute references, or both.
|
Argument |
Description |
Settings |
|---|---|---|
|
|
The formula you want to convert. |
Must be a valid formula beginning with an equals sign |
|
|
The |
|
|
|
The |
|
|
|
The converted |
|
|
|
The cell that references are relative to. Defaults to active cell. |
|
The following code converts a formula to R1C1 style relative to cell A1:
Sub TestConvertFormula( )
Dim str As String
str = "=Sum(A1:A20)"
Debug.Print Application.ConvertFormula(str, xlA1, xlR1C1, _
xlRelative, [a1])
End SubBecome an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access