+ Reply to Thread
Results 1 to 5 of 5

VBA - Advanced lookup and nested if's for a statistical analysis

  1. #1
    Registered User
    Join Date
    06-10-2012
    Location
    Inidanapolis, IN
    MS-Off Ver
    Excel 2007
    Posts
    3

    VBA - Advanced lookup and nested if's for a statistical analysis

    I'm attempting to create a macro that will lookup the value in a cell, run a separate macro (statistical analysis), copy a range, then paste those values in another worksheet.

    Per the attached sample workbook:

    I want to run a macro, "Analysis" which I have already created, for each entry, starting at A4 under the 'Data' worksheet (These entries are serial numbers for a specific engine). This data will change depending on what I want to filter it by and can range from 10 entries to 400.

    The Analysis macro is dependent on the A1 cell in the 'Forecast' worksheet. Once the A1 field is updated with the next entry from the Data list, the Analysis macro will populate values on the 'Forecast' worksheet for each engine. I then want to record the 'Run Average' line for each engine on the 'Results' worksheet.

    My trouble is that I'm not sure how to write the code to be dynamic enough to run through the entire data list (regardless of how many engines are displayed in the list).

    Any help or advice would be extremely appreciated.
    Attached Files Attached Files

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: VBA - Advanced lookup and nested if's for a statistical analysis

    haven't tested but something like this I reckon
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    06-10-2012
    Location
    Inidanapolis, IN
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: VBA - Advanced lookup and nested if's for a statistical analysis

    Wow, thank you for the quick reply. I have made the necessary adjustments and it looks like it will work perfectly!! Although what would I need to change in order to paste the value for the results instead of the formula? Because when I run it, returns #REF.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: VBA - Advanced lookup and nested if's for a statistical analysis

    change this line
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-10-2012
    Location
    Inidanapolis, IN
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: VBA - Advanced lookup and nested if's for a statistical analysis

    Perfect!!! I can't thank you enough!! I've been stumped on that for a week now. My next problem is to speed up the process (With 500 entries it can take awhile) but that's a whole other topic that I will tackle another time.

    Thank you for your time!! --Andy

+ 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