+ Reply to Thread
Results 1 to 3 of 3

Macro Showing Formula and Result

  1. #1
    Simon
    Guest

    Macro Showing Formula and Result

    Hi All,

    I'm very new to writing Macro's in excel, what I want to know is If I have
    a macro which tells excel that Cell A1 = Cell A2 * Cell A3. Then is it
    possible that once the macro executes that the result is shown in cell A1 and
    if you click on cell A1 you can also see the formula i.e =A2*A3, rather than
    just being able to see the result which is how it is at the moment.

    Thanks.
    Simon

  2. #2
    Tom Ogilvy
    Guest

    Re: Macro Showing Formula and Result

    Range("A1").Formula = "=A2*A3"


    --
    Regards,
    Tom Ogilvy

    "Simon" <[email protected]> wrote in message
    news:[email protected]...
    > Hi All,
    >
    > I'm very new to writing Macro's in excel, what I want to know is If I

    have
    > a macro which tells excel that Cell A1 = Cell A2 * Cell A3. Then is it
    > possible that once the macro executes that the result is shown in cell A1

    and
    > if you click on cell A1 you can also see the formula i.e =A2*A3, rather

    than
    > just being able to see the result which is how it is at the moment.
    >
    > Thanks.
    > Simon




  3. #3
    Jim Thomlinson
    Guest

    RE: Macro Showing Formula and Result

    What you want to do is not possible (if I understand the question correctly).
    Your macro pastes the value of the product of Cells A2 and A3 into A1. If A2
    is 2 and A3 is 3 then your macro puts the number 6 into Cell A1. This is just
    a number and cell A1 has no idea how that number got in there. Tom's solution
    is the best idea in that instead of the 6 into A1 it puts the formula into A1
    which gives you what you need.
    --
    HTH...

    Jim Thomlinson


    "Simon" wrote:

    > Hi All,
    >
    > I'm very new to writing Macro's in excel, what I want to know is If I have
    > a macro which tells excel that Cell A1 = Cell A2 * Cell A3. Then is it
    > possible that once the macro executes that the result is shown in cell A1 and
    > if you click on cell A1 you can also see the formula i.e =A2*A3, rather than
    > just being able to see the result which is how it is at the moment.
    >
    > Thanks.
    > Simon


+ 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