43224


(例)  
=1*2+3*4 A=4  
=1*2+3 A=4  
=R1C1*R1C2+R1C3*R7C8 A=R1C1+R1C3  
他の言語でも参考のページがあれば教えて下さい。よろしくお願いします。

ーーーーーーー  
20180407追加  
ありがとうございます。

[code]

    Sub aTest()
        Cells(1, 5) = "=1*2+3*(-4)"
        Cells(2, 5) = "=1*2+3"
        Cells(3, 5) = "=3+1*2"
        Cells(4, 1) = "1"
        Cells(4, 2) = "2"
        Cells(4, 3) = "3"
        Cells(4, 4) = "4"
        Cells(4, 5) = "=R4C1*R4C2+R4C3*R4C4"
    '
        Cells(1, 7) = sigmaA(Cells(1, 5)) '4
        Cells(2, 7) = sigmaA(Cells(2, 5)) '4
        Cells(3, 7) = sigmaA(Cells(3, 5)) '4
        Cells(4, 7) = sigmaA(Cells(4, 5)) '4
    End Sub
    
[/code]


CC BY-SA 3.0
2018-04-13T14:41:47.380
43217
2018-04-16T16:09:11.463
2018-04-16T16:09:11.463
17199
17199
question
vba
エクセル計算式=Σ(ai×bi)のA=Σaiを計算するvbaを探しています。


こんな感じ？

[code]

    Option Explicit
    Function sigmaA(arg As Range) As String
    Dim ary1
    Dim i As Long
        ary1 = Split(arg.FormulaR1C1, "+")
        For i = 0 To UBound(ary1)
            ary1(i) = Split(ary1(i), "*")(0)
        Next i
        sigmaA = Join(ary1, "+")
    End Function
    
[/code]


CC BY-SA 3.0
2018-04-14T02:00:43.580
43224
2018-04-14T03:48:46.840
2018-04-14T03:48:46.840
3605
43217
answer