Consulting

Results 1 to 2 of 2

Thread: Correlation Matrix through relative refrances

  1. #1

    Correlation Matrix through relative refrances

    I am trying to find correllations between an fixed array and then four others through relative refrancing.


    Sub x()

    Dim i As Integer
    i = 0

    For i = 0 To 5


    Cells(9, 2 + i).FormulaR1C1 = "=CORREL(R[-7]C:R[-3]C,R[-7]C[1 + i]:R[-3]C[1+i])"

    Next

    End Sub



    I thought this would work, but I get a application or object defined error

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    The i in the formula is causing a #NAME! error.

    [VBA]Cells(9, 2 + i).FormulaR1C1 = "=CORREL(R[-7]C:R[-3]C,R[-7]C[" & (1 + i) & "]:R[-3]C[" & (1 + i) & "])"[/VBA]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •