![]() |
|
||||||||
| Site Links |
| Consulting |
| Knowledge Base |
| Training |
| Forum |
| Articles |
| Resources |
| Products |
| Cool Tools |
| Contact |
| About Us |
| Go to Page... |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
|
Solved: Regression Analysis macro
I am working on automating a regression analysis for our field staff but I am running into a problem referencing the cell range for the regression. Essentially, I have a pre-made form that the sales staff fills out and then runs one of two macros depending upon what type of regression analysis is desired. These macros populate the data form that is the base of the regression analysis. This form could have anywhere from 1 to 88 entries. I am trying to find the last cell used (yLast) in the named range and by using an offset set the xLast cell. I can find the last y value cell and get the offset to the xLast cell but when I try to use these as a reference in the regression code, I get an "application or object defined error.
Here is the code: Code:
Any help would be greatly appreciated. Tim |
|
Local Time: 04:10 PM
Local Date: 05-22-2013 Location:
|
|
|
|
#2 |
|
|
Is there a specifc reason why you are using the 'Application.Run' syntax?
VBA:
VBA tags courtesy of www.thecodenet.com
I'm pretty sure that if you want to pass Objects to a subroutine, you need to call it as a VBA Sub. VBA:
VBA tags courtesy of www.thecodenet.com
|
|
Local Time: 05:10 PM
Local Date: 05-22-2013 Location:
|
|
|
|
#3 |
|
|
I don't see where you're putting a value into yLast. I think you meant yEnd?
Actually, it does not seemed to be Dim-ed. Did you use Option Explicit at the top of your module? That still won't work, since yEnd is a Range. Your probably want yEnd.Row since you're making a address (string) will give something like Range("$e$10:$E$1000") Paul |
|
Local Time: 05:10 PM
Local Date: 05-22-2013 Location:
|
|
|
|
#4 |
|
|
Dr. K
To answer your question, the syntax for the regression came from a recorded macro. I took this as a shortcut. |
|
Local Time: 04:10 PM
Local Date: 05-22-2013 Location:
|
|
|
|
#5 |
|
|
Solved Regression Macro
Paul
Thanks. That did the trick. Sometimes the answer lies in the basics and I get wrapped up in the code and forget the simple things. Tim ![]() |
|
Local Time: 04:10 PM
Local Date: 05-22-2013 Location:
|
|
![]() |
| Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|


