VBA Error

ajc5382

New Member
Joined
Jun 25, 2012
Messages
41
Hi all,

I'm getting the following error in a macro I've written that is currently calculating a rolling correlation.
Error 1004: Unable to get the Correl property of the worksheet function class
Here's the code: rng correl represents the number of days to take the correlation over; correlcalc represents the number of rows of data



rngcorrel = Worksheets("GUI").Cells(15, 2)
correlcalc = WorksheetFunction.CountA(Sheets("INFO").Range("A:A"))


Do Until Worksheets("info").Cells(rngcorrel + i, 2).Value = ""
For i = 1 To correlcalc

Cor1 = WorksheetFunction.correl(INFO.Range(INFO.Cells(1 + i, 2), INFO.Cells(rngcorrel + i, 2)), INFO.Range(INFO.Cells(1 + i, 3), INFO.Cells(rngcorrel + i, 3)))
INFO.Cells(rngcorrel + i, 6) = Cor1
Next i


Exit Do


Loop
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top