+ Reply to Thread
Results 1 to 3 of 3

regression macro on multiple sheets

  1. #1
    Registered User
    Join Date
    10-31-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    regression macro on multiple sheets

    Hi all,

    I am very new to excel macro and am finding this way out of my depth

    I am trying to write a vba macro which does the following:

    Checks whether a value in Sheet 2 is >30 (say cell B56).
    if true then it runs a regression using values from sheet1 - Y=B27:B56 and X=BHN27:BHP56 (30 observations)
    (the equation is Y=b0+b1X1+b2X2+b3X3).
    Then in sheet 3 it gives the sum of b1+b2+b3 from the regression in cellB56.

    if the first condition wasnt true then it moves to the next cell and performs the regression on the corresponding 30 observations. I have to do it for cells B2 to BHM556.

    I have added an attachment of the sample file.


    Hope you can help me.

    Garry
    Attached Files Attached Files

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: regression macro on multiple sheets

    Did you try the Excel formulae ? probably you'll find a builtin formula that does exactly what you need.



  3. #3
    Registered User
    Join Date
    10-31-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: regression macro on multiple sheets

    Again, I am not quite sure which function would do it, any guidance would be wonderful.

    G

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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