+ Reply to Thread
Results 1 to 4 of 4

Thread: Collect calculation result automatically in a table

  1. #1
    Registered User
    Join Date
    08-20-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    2

    Collect calculation result automatically in a table

    If I have the equation for example Y = Function (X)

    Where X and Y are variables.

    How to automatically collect all the VARIOUS results of Y in a separate sheet as X changes.

    I want to ultimately plot the fluctuations in Y, as X changes. For this reason I want to capture all the values of Y, as they occur.

    Thanks a lot.

  2. #2
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,224

    Re: Collect calculation result automatically in a table

    This would, of course, require VBA. A macro would watch as the cell with this formula in it changes, and each time it does it would copy the new information to your log.

    See the attached file for an example of this kind of macro in action.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-20-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Collect calculation result automatically in a table

    Thanks JBeaucaire. That's what I wanted.

    Can you give me step by step instructions on how to transfer this VBA to my own sheet?

    I'm a beginner but have successfully copied and pasted VBA code into excel, but that was about 1 year back.

  4. #4
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,224

    Re: Collect calculation result automatically in a table

    This is sheet level code. It is active on the sheet at all times unless you suspend macros with the Design Mode button on the Controls Toolbar.

    In my sheet, the code can be see by -right-clicking the tab and selecting View Code. The module that opens is the sheet module, copy all that code.

    Open the sheet module for your sheet the same way... paste in the starting code, then read through it until you fully understand what every line of code does. At that point you can begin the "tweaking" process for your scenario.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

+ 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.2.0