开发者

convert A1 formula and Array into L1C1 formula and vice-versa

开发者 https://www.devze.com 2023-03-17 02:30 出处:网络
Is there a way to convert the fashion A1 formula and array into the fashion L1C1 formula and 开发者_运维技巧vice-versa in Excel?Application.ConvertFormula Method.

Is there a way to convert the fashion A1 formula and array into the fashion L1C1 formula and 开发者_运维技巧vice-versa in Excel?


Application.ConvertFormula Method.

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


Not sure if I fully understand the question but you can interchange the formula type of a cell/range using combinations of the methods below

Sub test()
With Sheet1
    Set Rng = .Range("A1")

    'method1
    Formula = Rng.FormulaR1C1
    Rng.FormulaR1C1 = Formula

    'method2
    Formula = Rng.FormulaR1C1
    Rng.Formula = Formula

    'method3
    Formula = Rng.Formula
    Rng.Formula = Formula

    'method4
    Formula = Rng.Formula
    Rng.FormulaArray = Formula

End With
End Sub


By Chance, I was looking the book "VBA and Macros for Microsoft Office Excel 2007 - Bill Jelen" he says that: 1)In the Editor VBA; 2)type CTRL+G; 3)type "Print ActiveCell.FormulaL1C1"; 4)press Enter;

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号