ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Macro (https://www.excelbanter.com/excel-programming/367044-vba-macro.html)

redlion[_2_]

VBA Macro
 

Hi There,

I have a number of formulars for example =SUM(B2/C2) in Cell D9 how do
i get a macro to calculate all of these for me and put the answer in D9
for me.

A list of some others
Current Ratio =SUM(B2/C2)
Total Asset Turnover =SUM(K2/L2)
Debt-to-Equity =SUM(C2+O2)/P2
Dividend Per Share =SUM(T2/S2)
Luqid Ratio =SUM(B2-I2)/(C2-F2)

Thanks Heaps






Thanks Heaps


--
redlion
------------------------------------------------------------------------
redlion's Profile: http://www.excelforum.com/member.php...o&userid=36140
View this thread: http://www.excelforum.com/showthread...hreadid=560934


NickHK

VBA Macro
 
Not sure what you mean, but if you have a formula in a cell, it returns a
value.
So, your cell D9 will show the result of the formula.
Not sure how/why you want all these results in D9; makes no sense.

Also, in these formulae, you use SUM. As you only have single arguments, SUM
serves no purpose here.

NickHK

"redlion" wrote in
message ...

Hi There,

I have a number of formulars for example =SUM(B2/C2) in Cell D9 how do
i get a macro to calculate all of these for me and put the answer in D9
for me.

A list of some others
Current Ratio =SUM(B2/C2)
Total Asset Turnover =SUM(K2/L2)
Debt-to-Equity =SUM(C2+O2)/P2
Dividend Per Share =SUM(T2/S2)
Luqid Ratio =SUM(B2-I2)/(C2-F2)

Thanks Heaps






Thanks Heaps


--
redlion
------------------------------------------------------------------------
redlion's Profile:

http://www.excelforum.com/member.php...o&userid=36140
View this thread: http://www.excelforum.com/showthread...hreadid=560934




redlion[_3_]

VBA Macro
 

Sorry NickHK,

All I need is a macro which uses this formula =SUM((D2+E2))/2*(365)/J
and put the answer in cell E9

Regard

--
redlio
-----------------------------------------------------------------------
redlion's Profile: http://www.excelforum.com/member.php...fo&userid=3614
View this thread: http://www.excelforum.com/showthread.php?threadid=56093


NickHK

VBA Macro
 
Why not just put the formula in E9:
=SUM((D2,E2))/2*(365)/J2

Note, you do not need "SUM" and "+". One or the other.

NickHK

"redlion" wrote in
message ...

Sorry NickHK,

All I need is a macro which uses this formula =SUM((D2+E2))/2*(365)/J2
and put the answer in cell E9

Regards


--
redlion
------------------------------------------------------------------------
redlion's Profile:

http://www.excelforum.com/member.php...o&userid=36140
View this thread: http://www.excelforum.com/showthread...hreadid=560934




redlion[_4_]

VBA Macro
 

Because I would like it Macro driven so other uses can not stuff up the
formulars, but I Got Thanks Mate

Sub Ratio()
Sheets("data").Select
Range("E21").Value = Evaluate("=SUM((D2+E2))/2*(365)/J2 ")
End Sub


--
redlion
------------------------------------------------------------------------
redlion's Profile: http://www.excelforum.com/member.php...o&userid=36140
View this thread: http://www.excelforum.com/showthread...hreadid=560934


NickHK

VBA Macro
 
That's why you can Protect the worksheet.

NickHK

"redlion" wrote in
message ...

Because I would like it Macro driven so other uses can not stuff up the
formulars, but I Got Thanks Mate

Sub Ratio()
Sheets("data").Select
Range("E21").Value = Evaluate("=SUM((D2+E2))/2*(365)/J2 ")
End Sub


--
redlion
------------------------------------------------------------------------
redlion's Profile:

http://www.excelforum.com/member.php...o&userid=36140
View this thread: http://www.excelforum.com/showthread...hreadid=560934





All times are GMT +1. The time now is 10:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com