+ Reply to Thread
Results 1 to 6 of 6

formula after running a macro

Hybrid View

  1. #1
    SHIRA
    Guest

    formula after running a macro

    I have built a macro that is reading raw data and create a report from the
    data,the report is great but the formula aren't shown in the end report.

    for example:

    if in my macro i have made a sum of different fields the result in the
    report is a number without the formula.

    there is a way to see the embedded formula after running the macro.

  2. #2
    ben
    Guest

    RE: formula after running a macro

    without seeing your code my guess is you are populating the cells with the
    values rather than the formuals eg....

    MySum = application.worksheetfunction.sum("A1:A10")
    Range("a11") = MySum

    it should be

    range("a11") = "=Sum("""A1:A10""")"

    this will populate a formula into the cell and not just a value



    --
    When you lose your mind, you free your life.
    Ever Notice how we use '' for comments in our posts even if they aren''t
    expected to go into the code?


    "SHIRA" wrote:

    > I have built a macro that is reading raw data and create a report from the
    > data,the report is great but the formula aren't shown in the end report.
    >
    > for example:
    >
    > if in my macro i have made a sum of different fields the result in the
    > report is a number without the formula.
    >
    > there is a way to see the embedded formula after running the macro.


  3. #3
    ben
    Guest

    RE: formula after running a macro

    sorry for the quotes the formula should be

    range("a11") = "=Sum(A1:A10)"



    --
    When you lose your mind, you free your life.
    Ever Notice how we use '' for comments in our posts even if they aren''t
    expected to go into the code?


    "ben" wrote:

    > without seeing your code my guess is you are populating the cells with the
    > values rather than the formuals eg....
    >
    > MySum = application.worksheetfunction.sum("A1:A10")
    > Range("a11") = MySum
    >
    > it should be
    >
    > range("a11") = "=Sum("""A1:A10""")"
    >
    > this will populate a formula into the cell and not just a value
    >
    >
    >
    > --
    > When you lose your mind, you free your life.
    > Ever Notice how we use '' for comments in our posts even if they aren''t
    > expected to go into the code?
    >
    >
    > "SHIRA" wrote:
    >
    > > I have built a macro that is reading raw data and create a report from the
    > > data,the report is great but the formula aren't shown in the end report.
    > >
    > > for example:
    > >
    > > if in my macro i have made a sum of different fields the result in the
    > > report is a number without the formula.
    > >
    > > there is a way to see the embedded formula after running the macro.


  4. #4
    SHIRA
    Guest

    RE: formula after running a macro

    Thanks for the reply

    in fact this is what i am doing:
    inside a loop:

    clicks = clicks + Range("f" & CStr(i))
    and after exiting the loop:
    Range("f" & CStr(row + 1)) = clicks

    "ben" wrote:

    > sorry for the quotes the formula should be
    >
    > range("a11") = "=Sum(A1:A10)"
    >
    >
    >
    > --
    > When you lose your mind, you free your life.
    > Ever Notice how we use '' for comments in our posts even if they aren''t
    > expected to go into the code?
    >
    >
    > "ben" wrote:
    >
    > > without seeing your code my guess is you are populating the cells with the
    > > values rather than the formuals eg....
    > >
    > > MySum = application.worksheetfunction.sum("A1:A10")
    > > Range("a11") = MySum
    > >
    > > it should be
    > >
    > > range("a11") = "=Sum("""A1:A10""")"
    > >
    > > this will populate a formula into the cell and not just a value
    > >
    > >
    > >
    > > --
    > > When you lose your mind, you free your life.
    > > Ever Notice how we use '' for comments in our posts even if they aren''t
    > > expected to go into the code?
    > >
    > >
    > > "SHIRA" wrote:
    > >
    > > > I have built a macro that is reading raw data and create a report from the
    > > > data,the report is great but the formula aren't shown in the end report.
    > > >
    > > > for example:
    > > >
    > > > if in my macro i have made a sum of different fields the result in the
    > > > report is a number without the formula.
    > > >
    > > > there is a way to see the embedded formula after running the macro.


  5. #5
    ben
    Guest

    RE: formula after running a macro

    hmmm

    range("f" & row+1) = "=Sum(F" & LowestRow & ":f" & HighestRow & ")"
    use lowest/highest row to determine start and stop point and use above line
    outside of code

    --
    When you lose your mind, you free your life.
    Ever Notice how we use '' for comments in our posts even if they aren''t
    expected to go into the code?


    "SHIRA" wrote:

    > Thanks for the reply
    >
    > in fact this is what i am doing:
    > inside a loop:
    >
    > clicks = clicks + Range("f" & CStr(i))
    > and after exiting the loop:
    > Range("f" & CStr(row + 1)) = clicks
    >
    > "ben" wrote:
    >
    > > sorry for the quotes the formula should be
    > >
    > > range("a11") = "=Sum(A1:A10)"
    > >
    > >
    > >
    > > --
    > > When you lose your mind, you free your life.
    > > Ever Notice how we use '' for comments in our posts even if they aren''t
    > > expected to go into the code?
    > >
    > >
    > > "ben" wrote:
    > >
    > > > without seeing your code my guess is you are populating the cells with the
    > > > values rather than the formuals eg....
    > > >
    > > > MySum = application.worksheetfunction.sum("A1:A10")
    > > > Range("a11") = MySum
    > > >
    > > > it should be
    > > >
    > > > range("a11") = "=Sum("""A1:A10""")"
    > > >
    > > > this will populate a formula into the cell and not just a value
    > > >
    > > >
    > > >
    > > > --
    > > > When you lose your mind, you free your life.
    > > > Ever Notice how we use '' for comments in our posts even if they aren''t
    > > > expected to go into the code?
    > > >
    > > >
    > > > "SHIRA" wrote:
    > > >
    > > > > I have built a macro that is reading raw data and create a report from the
    > > > > data,the report is great but the formula aren't shown in the end report.
    > > > >
    > > > > for example:
    > > > >
    > > > > if in my macro i have made a sum of different fields the result in the
    > > > > report is a number without the formula.
    > > > >
    > > > > there is a way to see the embedded formula after running the macro.


  6. #6
    SHIRA
    Guest

    RE: formula after running a macro

    thank you

    "ben" wrote:

    > hmmm
    >
    > range("f" & row+1) = "=Sum(F" & LowestRow & ":f" & HighestRow & ")"
    > use lowest/highest row to determine start and stop point and use above line
    > outside of code
    >
    > --
    > When you lose your mind, you free your life.
    > Ever Notice how we use '' for comments in our posts even if they aren''t
    > expected to go into the code?
    >
    >
    > "SHIRA" wrote:
    >
    > > Thanks for the reply
    > >
    > > in fact this is what i am doing:
    > > inside a loop:
    > >
    > > clicks = clicks + Range("f" & CStr(i))
    > > and after exiting the loop:
    > > Range("f" & CStr(row + 1)) = clicks
    > >
    > > "ben" wrote:
    > >
    > > > sorry for the quotes the formula should be
    > > >
    > > > range("a11") = "=Sum(A1:A10)"
    > > >
    > > >
    > > >
    > > > --
    > > > When you lose your mind, you free your life.
    > > > Ever Notice how we use '' for comments in our posts even if they aren''t
    > > > expected to go into the code?
    > > >
    > > >
    > > > "ben" wrote:
    > > >
    > > > > without seeing your code my guess is you are populating the cells with the
    > > > > values rather than the formuals eg....
    > > > >
    > > > > MySum = application.worksheetfunction.sum("A1:A10")
    > > > > Range("a11") = MySum
    > > > >
    > > > > it should be
    > > > >
    > > > > range("a11") = "=Sum("""A1:A10""")"
    > > > >
    > > > > this will populate a formula into the cell and not just a value
    > > > >
    > > > >
    > > > >
    > > > > --
    > > > > When you lose your mind, you free your life.
    > > > > Ever Notice how we use '' for comments in our posts even if they aren''t
    > > > > expected to go into the code?
    > > > >
    > > > >
    > > > > "SHIRA" wrote:
    > > > >
    > > > > > I have built a macro that is reading raw data and create a report from the
    > > > > > data,the report is great but the formula aren't shown in the end report.
    > > > > >
    > > > > > for example:
    > > > > >
    > > > > > if in my macro i have made a sum of different fields the result in the
    > > > > > report is a number without the formula.
    > > > > >
    > > > > > there is a way to see the embedded formula after running the macro.


+ 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