+ Reply to Thread
Results 1 to 6 of 6

VBA Macro:put the answer in D9

  1. #1
    Registered User
    Join Date
    07-06-2006
    Posts
    8

    VBA Macro:put the answer in D9

    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

  2. #2
    NickHK
    Guest

    re: VBA Macro:put the answer in D9

    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" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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
    >




  3. #3
    Registered User
    Join Date
    07-06-2006
    Posts
    8
    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

  4. #4
    NickHK
    Guest

    re: VBA Macro:put the answer in D9

    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" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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
    >




  5. #5
    Registered User
    Join Date
    07-06-2006
    Posts
    8
    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

  6. #6
    NickHK
    Guest

    re: VBA Macro:put the answer in D9

    That's why you can Protect the worksheet.

    NickHK

    "redlion" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1