I am trying to write a macro that will run a regression analysis for me using ranges that I define in cells A1 (for the Y variable) and B1 (for the X variables). For example, a sample size of 250 will produce the following cell contents: A1 contains "$B$13:$B$263" and B1 contains "$C$13:$I$263". Changing the sample size for my regression will change the contents of cells A1 & B1.
In the VBA code below, the Y & X ranges for my regression are fixed, but I would like them to be variable and take on whatever "value" is in cells A1 & B1. I have spent hours searching message boards and sought advice from co-workers, to no avail. Please HELP!
Application.Run "Regress",
ActiveSheet.Range("$B$13:$B$263"),
ActiveSheet.Range("$C$13:$I$263"),
False, False, , _"macro regr", False, False, False, False, , False
In the VBA code below, the Y & X ranges for my regression are fixed, but I would like them to be variable and take on whatever "value" is in cells A1 & B1. I have spent hours searching message boards and sought advice from co-workers, to no avail. Please HELP!
Application.Run "Regress",
ActiveSheet.Range("$B$13:$B$263"),
ActiveSheet.Range("$C$13:$I$263"),
False, False, , _"macro regr", False, False, False, False, , False