Forum Discussion
Trevor Korba
May 04, 2018Copper Contributor
Jensen's Alpha
I'm trying to run a Jensen's Regression and my code is not working. The debugger says my offcol = UBound(result, 1) is a type mismatch. Below is the code I have wrote. Any help would be great. Su...
Matt Mickle
May 05, 2018Bronze Contributor
Hey Trevor, hope you're doing well. Typically a type mismatch error occurs when you try to assign a variable a value that is not consistent with the declaration. Can you add a line to tell you what the value of result is? It would be beneficial to have a small non-sensitive mockup to help test the code if possible.
result = Application.LinEst(Range(yrange).Value, Range(xrange).Value, 1, 1)
msgBox result
What does the msgbox return?