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
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