Hello.
I have a macro problem.
I tried to write it in various ways, but nothing works, or he typed O or #NAME? Everywhere.
I would like to write a macro that in the Shares sheet in F: 2 to F: 180 will write the result of the multiplication, the first argument of which is from the Shares sheet from A: 2 to A: 180 (but it probably is well written with this RC [-5]) and the second is from the Averages sheet in cell A2 (i.e. from A2 Shares * A2 Average, A3 Shares * A2 Average, A4 Shares * A2 Average). Plus + multiplication of the argument from the worksheet Shares from B: 2 to B: 180 with the argument from the worksheet Averages in cell B2 (i.e. the same from B2 shares * from B2 average, B3 shares * B2 average, B4 shares * B2 average). And so on with cell C and D.
Here are my macros (which have an error somewhere, but I don't know where):
Sub Count_share ()
t = Sheets ("Averages"). Cells (2, 1) .Value
x = Sheets ("Average"). Cells (2, 2) .Value
y = Sheets ("Averages"). Cells (2, 3) .Value
z = Sheets ("Averages"). Cells (2, 4) .Value
Worksheets ("Shares"). Range ("F2: F180"). FormulaR1C1 = _
"= Shares! RC [-5] * t + Shares! RC [-4] * x + Shares! RC [-3] * y + Shares! RC [-2] * z"
End Sub
or
Sub Count_Share ()
t = Means! A2
x = Means! B2
y = Means! C2
Z = Medium! D2
Worksheets ("Shares"). Range ("F2: F180"). FormulaR1C1 = _
"= Shares! RC [-5] * t + Shares! RC [-4] * x + Shares! RC [-3] * y + Shares! RC [-2] * z"
End Sub
I tried instead of:
Worksheets ("Shares"). Range ("F2: F180"). FormulaR1C1 = _
"= Shares! RC [-5] * t + Shares! RC [-4] * x + Shares! RC [-3] * y + Shares! RC [-2] * z"
enter (without these variables t, x, y, z):
'"= Shares! RC [-5] * Shares! RC [-5] * Shares! RC [-4] * Shares! RC [-4] * Shares! RC [-3] * Shares! RC [-3] * Shares. (2, 3). + Shares! RC [-2] * Average Cells (2, 4) "
'"= Shares! RC [-5] * Averages! A2 + Shares! RC [-4] * Averages! B2 + Shares! RC [-3] * Averages! C2 + Shares! RC [-2] * Averages! D2 "
(in this case, he marks me in the formula in exel 'A2', 'B2' etc., he writes it to me in the formula, I don't know why.
Thanks in advance for your help.
End Sub
I have a macro problem.
I tried to write it in various ways, but nothing works, or he typed O or #NAME? Everywhere.
I would like to write a macro that in the Shares sheet in F: 2 to F: 180 will write the result of the multiplication, the first argument of which is from the Shares sheet from A: 2 to A: 180 (but it probably is well written with this RC [-5]) and the second is from the Averages sheet in cell A2 (i.e. from A2 Shares * A2 Average, A3 Shares * A2 Average, A4 Shares * A2 Average). Plus + multiplication of the argument from the worksheet Shares from B: 2 to B: 180 with the argument from the worksheet Averages in cell B2 (i.e. the same from B2 shares * from B2 average, B3 shares * B2 average, B4 shares * B2 average). And so on with cell C and D.
Here are my macros (which have an error somewhere, but I don't know where):
Sub Count_share ()
t = Sheets ("Averages"). Cells (2, 1) .Value
x = Sheets ("Average"). Cells (2, 2) .Value
y = Sheets ("Averages"). Cells (2, 3) .Value
z = Sheets ("Averages"). Cells (2, 4) .Value
Worksheets ("Shares"). Range ("F2: F180"). FormulaR1C1 = _
"= Shares! RC [-5] * t + Shares! RC [-4] * x + Shares! RC [-3] * y + Shares! RC [-2] * z"
End Sub
or
Sub Count_Share ()
t = Means! A2
x = Means! B2
y = Means! C2
Z = Medium! D2
Worksheets ("Shares"). Range ("F2: F180"). FormulaR1C1 = _
"= Shares! RC [-5] * t + Shares! RC [-4] * x + Shares! RC [-3] * y + Shares! RC [-2] * z"
End Sub
I tried instead of:
Worksheets ("Shares"). Range ("F2: F180"). FormulaR1C1 = _
"= Shares! RC [-5] * t + Shares! RC [-4] * x + Shares! RC [-3] * y + Shares! RC [-2] * z"
enter (without these variables t, x, y, z):
'"= Shares! RC [-5] * Shares! RC [-5] * Shares! RC [-4] * Shares! RC [-4] * Shares! RC [-3] * Shares! RC [-3] * Shares. (2, 3). + Shares! RC [-2] * Average Cells (2, 4) "
'"= Shares! RC [-5] * Averages! A2 + Shares! RC [-4] * Averages! B2 + Shares! RC [-3] * Averages! C2 + Shares! RC [-2] * Averages! D2 "
(in this case, he marks me in the formula in exel 'A2', 'B2' etc., he writes it to me in the formula, I don't know why.
Thanks in advance for your help.
End Sub