I want to test a condition and if its true then i want to store that index for which it is true in an array. But the array isn't taking up values. My code:
Dim yridx(50, 2) As Integer
For i = X To 1 Step -1
If (Year(Range("A" & i).Value) <> Year(Range("A" & j).Value)) Then
yridx(t, 0) = j - 1
yridx(t, 1) = i
t = t + 1
yr(t) = Year(Cells(i + 7, 1))
j = i
End If
Next
'All necessary variables are defined. I need help urgently.
Dim yridx(50, 2) As Integer
For i = X To 1 Step -1
If (Year(Range("A" & i).Value) <> Year(Range("A" & j).Value)) Then
yridx(t, 0) = j - 1
yridx(t, 1) = i
t = t + 1
yr(t) = Year(Cells(i + 7, 1))
j = i
End If
Next
'All necessary variables are defined. I need help urgently.