Hi. Interesting problem. I see that you have included the variable x in the formula string. Excel will not know the value of x when it looks at the formula.
...
Actually, I think the only problem with the original code is that the
x was inside the quotes, and thus inserted directly as part of the string, rather than its
value being used. Anyway...
Do you think this would work?
- For I = 1 To Sheets.Count - 1
-
For J = I + 1 To Sheets.Count
-
Sheets(1).Cells(1, I).FormulaR1C1 = "=CORREL(" & _
-
Sheets(I).Name & "!R2C2:R1700C2, " & _
-
Sheets(J).Name & "!R2C2:R1700C2)"
-
Next I
-
Next
The idea of this is to use a nested FOR loop to go through all the possible combinations - 9,801 of them, I think. Or was the intention only to check each sheet against the next one, or what?