Sanket Patel
i do stuff
- Joined
- 3/4/08
- Messages
- 543
- Points
- 28
In the process of writing some code to automate some calculations, I need to estimate a correlations matrix. I know I can use Application.WorkSheetFunction.Correl but that I have a huge range of returns and I don't feel like writing loops. I also don't feel like writing code to manually calculate the correlations.
I installed the Analysis ToolPak - VBA addin hoping that I could use the Correlation function that comes with the addin. I added a reference to the library and went through Object Browser and found the MCorrel() function that comes with addin.
My question is, how the heck do I actually call the function from my sub routine? It seems I have to tell VBA that I want to use a function from the atpvbaen.xls library, but how exactly do I do that?
I installed the Analysis ToolPak - VBA addin hoping that I could use the Correlation function that comes with the addin. I added a reference to the library and went through Object Browser and found the MCorrel() function that comes with addin.
My question is, how the heck do I actually call the function from my sub routine? It seems I have to tell VBA that I want to use a function from the atpvbaen.xls library, but how exactly do I do that?