I'm doing a for loop and need to use a Variant Array type, but i'm getting Error 13 (type mismatch). I want k to be 3, 4 and 5 for the 1st value, and so on (according to variable inspection below). I just don't know how to make vba read the array. I've tried using tsperiodo(i)(j) but it hasn't worked either.
Here is the variant array:
ReDim ocup(1 To numDis, 1 To numSalas) As Variant
For i = 1 To numDis
For j = 1 To numSalas
If capacidadeSalas(j) - alunos(i) >= 0 Then
ocup(i, j) = 1
End If
Next
Next
ReDim tsPeriodo(1 To numDis) As Variant
For i = 1 To numDis
tsPeriodo(i) = Application.Transpose(Evaluate("=ROW(" & tsInicio(i) & ":" & tsFim(i) & ")"))
Next
and here is where i want to use it:
For i = 1 To ocup(numDis, 1)
For j = 1 To ocup(1, numSalas)
For k = 1 To tsPeriodo(i) 'this is where im getting error 13
variable = "x_" & i & "_" & j & "_" & k
Next
Next
Next
For i = 1 To ocup(numDis, 1)suppost to be ?tsInicio(i)andtsFim(i)are instantiated.Evaluate("=ROW(" & tsInicio(i) & ":" & tsFim(i) & ")")will just return the a number not an array.