I've made a very simple code to calculate the matrix variance-covariance of a variable range of data depending on T1, T2, A and B. The code calculates only a part of it and then gives me an error. Can you help me please?

Dim A As Integer
Dim B As Integer
Dim T1 As Integer
Dim T2 As Integer
T1 = 4
T2 = 6
A = 1
B = 3

For i = 1 To 10
A = A + 2

For j = 1 To 10

B = B + 2

If i = j Then
Sheets("Markowitz").Range("V2").Offset(i, j) = Application.WorksheetFunction.Var(Sheets("Markowitz").Range(Cells(T1, A), Cells(T2, A)))
Else
Sheets("Markowitz").Range("V2").Offset(i, j) = Application.WorksheetFunction.covar(Range(Cells(T1, A), Cells(T2, A)), Range(Cells(T1, B), Cells(T2, B)))
End If

Sheets("Markowitz").Range("V2").Offset(j, i) = Sheets("Markowitz").Range("V2").Offset(i, j)

Next j
Next i