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
Bookmarks