+ Reply to Thread
Results 1 to 3 of 3

Macro to run regressions on multiple sheets

  1. #1
    Registered User
    Join Date
    06-21-2011
    Location
    England
    MS-Off Ver
    2013
    Posts
    48

    Macro to run regressions on multiple sheets

    Hello,

    I am wondering if there is a way to run regressions on multiple sheets rather than one each time.

    I am attaching a ready sample file which has quite a few sheets. What I want to do is run a regression on all sheets.
    The dependent variable (Y) is the second column whereas the independent (X) is the first one. The constant term should be zero.

    Many thanks,

    Costas
    Attached Files Attached Files
    Last edited by Costasg; 08-03-2011 at 02:39 PM.

  2. #2
    Registered User
    Join Date
    06-21-2011
    Location
    England
    MS-Off Ver
    2013
    Posts
    48

    Re: Macro to run regressions on multiple sheets

    Ok, I have found the macro for the regression, made it work for all sheets. However the only problem that still remains is how to adjust the selection area in every sheet.
    My code looks like this:

    Please Login or Register  to view this content.

    What I want to do is instead of cells B47 and C47 in every sheet, I want the macro to automatically pick the last used cell, since a sheet can have less or more than 47 observations.

    Anyone could help?
    Last edited by Costasg; 08-03-2011 at 01:18 PM.

  3. #3
    Registered User
    Join Date
    06-21-2011
    Location
    England
    MS-Off Ver
    2013
    Posts
    48

    Re: Macro to run regressions on multiple sheets

    I found the solution, the code goes like this:


    Please Login or Register  to view this content.

+ 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